mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-18 07:18:34 +02:00
Undone whitespace
This commit is contained in:
@@ -33,7 +33,7 @@ function listenForClicks() {
|
||||
* send a "beastify" message to the content script in the active tab.
|
||||
*/
|
||||
function beastify(tabs) {
|
||||
browser.tabs.insertCSS({ code: hidePage }).then(() => {
|
||||
browser.tabs.insertCSS({code: hidePage}).then(() => {
|
||||
let url = beastNameToURL(e.target.textContent);
|
||||
browser.tabs.sendMessage(tabs[0].id, {
|
||||
command: "beastify",
|
||||
@@ -47,7 +47,7 @@ function listenForClicks() {
|
||||
* send a "reset" message to the content script in the active tab.
|
||||
*/
|
||||
function reset(tabs) {
|
||||
browser.tabs.removeCSS({ code: hidePage }).then(() => {
|
||||
browser.tabs.removeCSS({code: hidePage}).then(() => {
|
||||
browser.tabs.sendMessage(tabs[0].id, {
|
||||
command: "reset",
|
||||
});
|
||||
@@ -66,11 +66,12 @@ function listenForClicks() {
|
||||
* then call "beastify()" or "reset()" as appropriate.
|
||||
*/
|
||||
if (e.target.classList.contains("beast")) {
|
||||
browser.tabs.query({ active: true, currentWindow: true })
|
||||
browser.tabs.query({active: true, currentWindow: true})
|
||||
.then(beastify)
|
||||
.catch(reportError);
|
||||
} else if (e.target.classList.contains("reset")) {
|
||||
browser.tabs.query({ active: true, currentWindow: true })
|
||||
}
|
||||
else if (e.target.classList.contains("reset")) {
|
||||
browser.tabs.query({active: true, currentWindow: true})
|
||||
.then(reset)
|
||||
.catch(reportError);
|
||||
}
|
||||
@@ -92,6 +93,6 @@ function reportExecuteScriptError(error) {
|
||||
* and add a click handler.
|
||||
* If we couldn't inject the script, handle the error.
|
||||
*/
|
||||
browser.tabs.executeScript({ file: "/content_scripts/beastify.js" })
|
||||
.then(listenForClicks)
|
||||
.catch(reportExecuteScriptError);
|
||||
browser.tabs.executeScript({file: "/content_scripts/beastify.js"})
|
||||
.then(listenForClicks)
|
||||
.catch(reportExecuteScriptError);
|
||||
|
||||
Reference in New Issue
Block a user