From 62f613fab53131ffff9194e548453d4cd2928e74 Mon Sep 17 00:00:00 2001 From: achmizs Date: Sat, 2 Feb 2019 17:50:33 -0500 Subject: [PATCH] Fixes for Firefox, part I --- src/options.css | 1 + src/platform/chrome/background.js | 12 ++++-------- src/platform/firefox/background.js | 13 ------------- src/platform/firefox/manifest.json | 10 +++++----- 4 files changed, 10 insertions(+), 26 deletions(-) diff --git a/src/options.css b/src/options.css index c512834..150386d 100644 --- a/src/options.css +++ b/src/options.css @@ -17,6 +17,7 @@ body { min-height: 100vh; padding: 10px 20px; font-size: 1rem; + font-family: sans-serif; } body.noscroll { overflow: hidden; diff --git a/src/platform/chrome/background.js b/src/platform/chrome/background.js index 740c807..f0d45ad 100644 --- a/src/platform/chrome/background.js +++ b/src/platform/chrome/background.js @@ -20,15 +20,11 @@ chrome.runtime.onInstalled.addListener(() => { */ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { let icons = request.killingStickies ? { - "16": "images/ASK_on_16.png", - "32": "images/ASK_on_32.png", - "48": "images/ASK_on_48.png", - "128": "images/ASK_on_128.png" + "19": "images/ASK_on_19.png", + "38": "images/ASK_on_38.png", } : { - "16": "images/ASK_off_16.png", - "32": "images/ASK_off_32.png", - "48": "images/ASK_off_48.png", - "128": "images/ASK_off_128.png" + "19": "images/ASK_off_19.png", + "38": "images/ASK_off_38.png", }; chrome.pageAction.setIcon({ path: icons, diff --git a/src/platform/firefox/background.js b/src/platform/firefox/background.js index 2c41a03..09a1686 100644 --- a/src/platform/firefox/background.js +++ b/src/platform/firefox/background.js @@ -1,16 +1,3 @@ -/* Enables the page action (i.e., the browser toolbar icon). - */ -chrome.runtime.onInstalled.addListener(() => { - chrome.declarativeContent.onPageChanged.removeRules(undefined, () => { - chrome.declarativeContent.onPageChanged.addRules([{ - conditions: [ new chrome.declarativeContent.PageStateMatcher({ - pageUrl: { schemes: [ 'http', 'https' ] }, - }) - ], actions: [ new chrome.declarativeContent.ShowPageAction() ] - }]); - }); -}); - /* Toggle the toolbar icon based on whether stickies are, or are not, set to be killed on the current tab. diff --git a/src/platform/firefox/manifest.json b/src/platform/firefox/manifest.json index 6c2dd83..78d5c7e 100644 --- a/src/platform/firefox/manifest.json +++ b/src/platform/firefox/manifest.json @@ -13,7 +13,7 @@ "homepage_url": "https://git.sr.ht/~achmizs/AlwaysKillSticky.git", "permissions": [ "activeTab", "storage" ], "background": { - "scripts": ["background.js"] + "scripts": [ "background.js" ] }, "content_scripts": [ { "matches": [ "http://*/*", "https://*/*" ], @@ -21,17 +21,17 @@ "js": [ "functions.js", "contentScript.js" ] } ], - "page_action": { + "browser_action": { "default_popup": "popup.html", "default_title": "AlwaysKillSticky - Click the icon to control sticky-killing on this site!", "default_icon": { - "48": "images/ASK_on_48.png", - "96": "images/ASK_on_96.png", + "19": "images/ASK_on_19.png", + "38": "images/ASK_on_38.png" } }, "icons": { "48": "images/ASK_on_48.png", - "96": "images/ASK_on_96.png", + "96": "images/ASK_on_96.png" }, "options_ui": { "page": "options.html",