diff --git a/commands/README.md b/commands/README.md index 9cb9cc8..db36734 100644 --- a/commands/README.md +++ b/commands/README.md @@ -10,4 +10,4 @@ All it does is: It shows: -* how to use chrome.commands to register keyboard shortcuts for your extension. +* how to use browser.commands to register keyboard shortcuts for your extension. diff --git a/mocha-client-tests/addon/background.js b/mocha-client-tests/addon/background.js index c434fcc..f356388 100644 --- a/mocha-client-tests/addon/background.js +++ b/mocha-client-tests/addon/background.js @@ -12,4 +12,4 @@ var Background = { } }; -chrome.runtime.onMessage.addListener(Background.receiveMessage); +browser.runtime.onMessage.addListener(Background.receiveMessage); diff --git a/mocha-client-tests/addon/scripts/popup.js b/mocha-client-tests/addon/scripts/popup.js index b352b5f..9e32f28 100644 --- a/mocha-client-tests/addon/scripts/popup.js +++ b/mocha-client-tests/addon/scripts/popup.js @@ -3,7 +3,7 @@ if($game.innerText !== 'ping'){ $game.innerText = 'ping'; } else{ - chrome.runtime.sendMessage({action: 'ping'},function(response) { + browser.runtime.sendMessage({action: 'ping'}).then((response) => { $game.innerText = response; }); } diff --git a/react-es6-popup/src/popup.js b/react-es6-popup/src/popup.js index 045a618..52da0ca 100755 --- a/react-es6-popup/src/popup.js +++ b/react-es6-popup/src/popup.js @@ -11,7 +11,7 @@ class Popup extends React.Component { componentDidMount() { // Get the active tab and store it in component state. - chrome.tabs.query({active: true}, tabs => { + browser.tabs.query({active: true}).then(tabs => { this.setState({activeTab: tabs[0]}); }); } diff --git a/tabs-tabs-tabs/tabs.js b/tabs-tabs-tabs/tabs.js index 74c4fb5..4580520 100644 --- a/tabs-tabs-tabs/tabs.js +++ b/tabs-tabs-tabs/tabs.js @@ -164,12 +164,12 @@ document.addEventListener("click", (e) => { else if (e.target.classList.contains('switch-tabs')) { var tabId = +e.target.getAttribute('href'); - chrome.tabs.query({ + browser.tabs.query({ currentWindow: true - }, (tabs) => { + }).then((tabs) => { for (var tab of tabs) { if (tab.id === tabId) { - chrome.tabs.update(tabId, { + browser.tabs.update(tabId, { active: true }); }