0

How do I use chrome.extension.getViews() to take a variable or activate a function on the front page of my chrome extension?

I have read this documentation http://developer.chrome.com/extensions/extension.html#method-getViews but don't feel enlightened from it. I have no problem passing the information the other way with .getBackground but have not yet figured out how to pass in the other direction.

rolandnsharp
  • 281
  • 1
  • 4
  • 13
  • It returns a list of `window` objects. Example to get a `window` reference for all of your extension pages in a tab, and call a global function of the first result: `var views = chrome.extension.getViews({type:'tab'});views[0].callMethod();`. If you expect more tabs, just loop through the results. – Rob W Aug 17 '13 at 09:03
  • @RobW Cheers, I just ran it through and have it working with a variation, but it only works when the main page is open. Is it possible to communicate with the front page even when it is closed? – rolandnsharp Aug 17 '13 at 10:11
  • How do you want to talk with a page that doesn't exist? – Rob W Aug 17 '13 at 10:15

0 Answers0