summaryrefslogtreecommitdiff
path: root/src/bg
diff options
context:
space:
mode:
authorhackademix2020-02-29 19:03:39 +0100
committerhackademix2020-02-29 19:03:39 +0100
commite6af4b07c12156f67497917990a21070072e8bf6 (patch)
treea7fe5299fec74ace3c19e8abada96a3a1bcb8acc /src/bg
parent9a664f7b3b6a5315983317b0e47128b809bc5531 (diff)
downloadnoscript-e6af4b07c12156f67497917990a21070072e8bf6.tar.gz
noscript-e6af4b07c12156f67497917990a21070072e8bf6.tar.xz
noscript-e6af4b07c12156f67497917990a21070072e8bf6.zip
Minor adjustments for Firefox Preview (Fenix) compatibility.
Diffstat (limited to 'src/bg')
-rw-r--r--src/bg/RequestGuard.js4
-rw-r--r--src/bg/main.js11
2 files changed, 8 insertions, 7 deletions
diff --git a/src/bg/RequestGuard.js b/src/bg/RequestGuard.js
index 10ccfdb..31d79f5 100644
--- a/src/bg/RequestGuard.js
+++ b/src/bg/RequestGuard.js
@@ -114,7 +114,7 @@ var RequestGuard = (() => {
: (numAllowed ? "sub" : "no");
let showBadge = ns.local.showCountBadge && numBlocked > 0;
let browserAction = browser.browserAction;
- if (!browserAction.setIcon) { // mobile
+ if (!browserAction.setIcon) { // Fennec
browserAction.setTitle({tabId, title: `NoScript (${numBlocked})`});
return;
}
@@ -123,7 +123,7 @@ var RequestGuard = (() => {
browserAction.setBadgeText({tabId, text: showBadge ? numBlocked.toString() : ""});
browserAction.setBadgeBackgroundColor({tabId, color: [128, 0, 0, 160]});
browserAction.setTitle({tabId,
- title: `${VERSION_LABEL} \n${enforced ?
+ title: UA.mobile ? "NoScript" : `${VERSION_LABEL} \n${enforced ?
_("BlockedItems", [numBlocked, numAllowed + numBlocked]) + ` \n${report}`
: _("NotEnforced")}`
});
diff --git a/src/bg/main.js b/src/bg/main.js
index b1874f4..b09dcb1 100644
--- a/src/bg/main.js
+++ b/src/bg/main.js
@@ -109,12 +109,12 @@
// wiring main UI
let ba = browser.browserAction;
if ("setIcon" in ba) {
- //desktop
+ //desktop or Fenix
ba.setPopup({
popup: popupURL
});
} else {
- // mobile
+ // Fennec
ba.onClicked.addListener(async tab => {
try {
await browser.tabs.remove(await browser.tabs.query({
@@ -250,9 +250,10 @@
deferWebTraffic(this.initializing = init(),
async () => {
Commands.install();
-
- this.devMode = (await browser.management.getSelf()).installType === "development";
- if (!this.local.debug) {
+ try {
+ this.devMode = (await browser.management.getSelf()).installType === "development";
+ } catch(e) {}
+ if (!(this.local.debug || this.devMode)) {
debug = () => {}; // suppress verbosity
}
});