gottafixit
gottafixit copied to clipboard
How to access the background page from the browserAction popup
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;
...
}
don't you need message passing for that? https://developer.chrome.com/extensions/messaging
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!