gottafixit icon indicating copy to clipboard operation
gottafixit copied to clipboard

How to access the background page from the browserAction popup

Open dandv opened this issue 9 years ago • 2 comments

Re. https://github.com/foobarbecue/gottafixit/blob/master/chromeext/src/background.js#L2 - would this pattern help? We use it in a Chrome extension:

let MyApp = chrome.extension.getBackgroundPage().MyApp;
MyApp.asteroid.loginWithPassword(form.elements.email.value, form.elements.password.value).then(function (userId) {
  MyApp.userId = userId;
...
}

dandv avatar Aug 20 '15 16:08 dandv

don't you need message passing for that? https://developer.chrome.com/extensions/messaging

wiber avatar Jan 10 '16 15:01 wiber

Sorry for the long delay in replying to both of your comments. Either solution would probably work. Haven't had time to work on this project but if you submit a PR I'll pop it in!

foobarbecue avatar Feb 23 '16 05:02 foobarbecue