promisesSupported: !!(window.browser),
port: null,
+ currentUrl: null,
icons: {
call: {
port.postMessage({
action: 'joinAudioCall',
data: {
+ currentUrl: internals.currentUrl,
tada: internals.getRoot().runtime.getURL('sounds/tada.wav')
}
});
onDisconnect() {
internals.getRoot().browserAction.setBadgeText({ text: '' }, () => {});
internals.setIcon('call');
+ internals.currentUrl = null;
internals.port = null;
internals.getRoot().browserAction.enable();
},
internals.getRoot().browserAction.disable();
const activeTabs = await internals.getActiveTabs();
+
+ internals.currentUrl = activeTabs[0].url;
const execution = await internals.getRoot().tabs.executeScript(activeTabs[0].id, {
- file: '/content_script.js'
+ file: '/build/content_script.js'
+ }, () => {
+
+ if (internals.getRoot().runtime.lastError) {
+ internals.onDisconnect();
+ }
});
- if (!execution[0]) {
+ if (execution && !execution[0]) {
internals.onDisconnect();
}
- },
+ }
+ ,
hangUp() {