diff --git a/app/scripts/background/main.js b/app/scripts/background/main.js index 3f4bb76f..9265c7c2 100644 --- a/app/scripts/background/main.js +++ b/app/scripts/background/main.js @@ -61,8 +61,8 @@ */ 'do-script-injection': function (message) { const frameId = message.frameId; - chrome.windows.getCurrent(w => { - chrome.tabs.query({ active: true, windowId: w.id }, tabs => { + chrome.windows.getCurrent().then(w => { + chrome.tabs.query({ active: true, windowId: w.id }).then(tabs => { const target = { tabId: tabs[0].id }; diff --git a/app/scripts/modules/utils/utils.js b/app/scripts/modules/utils/utils.js index e6f95d37..c0d8f97a 100644 --- a/app/scripts/modules/utils/utils.js +++ b/app/scripts/modules/utils/utils.js @@ -128,8 +128,8 @@ function _getPort () { function _sendToAll(message, callback) { var frameId = message.frameId; var options; - chrome.windows.getCurrent(w => { - chrome.tabs.query({ active: true, windowId: w.id }, tabs => { + chrome.windows.getCurrent().then(w => { + chrome.tabs.query({ active: true, windowId: w.id }).then(tabs => { // options.frameId allows to send the message to // a specific frame instead of all frames in the tab if (frameId !== undefined) { diff --git a/app/scripts/popup/popup.ts b/app/scripts/popup/popup.ts index 13a019aa..3cb794ff 100644 --- a/app/scripts/popup/popup.ts +++ b/app/scripts/popup/popup.ts @@ -2,7 +2,7 @@ var utils = require('../modules/utils/utils.js'); -window.chrome.tabs.query({active: true, currentWindow: true}, function (tabs) { +window.chrome.tabs.query({active: true, currentWindow: true}).then(function (tabs) { // Create a port with background page for continuous message communication var port = utils.getPort();