chrome app - get access to permissions in manifest file @ run time
My manifest file has the following for testing purposes:
"permissions": [
"http://localhost:4000/",
Later on, the URL will point at a server & port on a centrally located box
on an intranet running node.js, sqlite, etc, so several clients can run
the app simultaneously against that server.
I'd like access to that URL information in my app so that the app knows
where to send xhr requests to. Right now I have it hard coded in the app
and would like to pass that information into the app from the
background.js via the typical :
pageWindow.addEventListener('load', function()
{pageWindow.houseKeeping(url);}, false);
I've also tried :
debugger;
chrome.management.get(chrome.app.runtime.id, function(a){console.log(a);});
inside the background.js just to see what I would get but that causes the
app to fail to come up. No debugger shows up either. How is anyone
supposed to debug something that's stone cold dead?
Although I don't really want to repeat the URL information a second time,
I've also tried adding the URL info as a command line parameter used to
bring up chrome via the launchData in:
chrome.app.runtime.onLaunched.addListener(function(launchData) {
but that consistently gives me undefined no matter what I put on the
command line. The documentation makes me think that it might be referring
only to file specs on the command line, but that's not really clear to me.
Anyone with any ideas?
No comments:
Post a Comment