Undone whitespace

This commit is contained in:
Michal Wozniak
2022-06-13 00:04:50 +01:00
parent 8c98d1a05b
commit a4936f5215

View File

@@ -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);