I think that communication with the Background script should be done directly by going: var background = chrome.extension.getBackgroundPage(); background.doSomething();
It's a lot easier. On Tue, Dec 15, 2009 at 6:50 PM, P F <cyberjunk2...@gmail.com> wrote: > Hi all, > > I have the feeling that > http://code.google.com/chrome/extensions/messaging.html is a bit outdated > (e.g. some params are missing) so I'm wondering if someone could help me > with the following situation. > > I have a Browser Action with a popup (popup.js). I have this line: > > chrome.extension.sendRequest(undefined, {requestUrl: requestUrl, success: > success, error: opt_error}); > > (it sends a request to itself containing an object with the above params, > which are defined earlier. There is no callback function) > > In the background page, I have: > chrome.extension.onRequest.addListener( > function(req, sender, sendResponse) { > console.log("got request"); > // TODO: Do something. > }); > > The console log doesn't show any messages, and any code I place in there > doesn't seem to execute. Just for kicks I also added "sendResponse();" to > the end but it didn't make a difference, either. > > Any idea what's up? I assume that I can send messages from the popup to > the background page...are there any tricks to it? FYI I'm doing this on > linux. > > thanks, > Paul > > -- > You received this message because you are subscribed to the Google Groups > "Chromium-extensions" group. > To post to this group, send email to chromium-extensi...@googlegroups.com. > To unsubscribe from this group, send email to > chromium-extensions+unsubscr...@googlegroups.com<chromium-extensions%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/chromium-extensions?hl=en. > -- Marcos Aruj Alvarez Ingeniero de Software ------------------------------- marcos.a...@gmail.com ----- -- You received this message because you are subscribed to the Google Groups "Chromium-extensions" group. To post to this group, send email to chromium-extensi...@googlegroups.com. To unsubscribe from this group, send email to chromium-extensions+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en.