diff --git a/src/content/about.html b/src/content/about.html index 626da15..10dbaab 100644 --- a/src/content/about.html +++ b/src/content/about.html @@ -16,6 +16,11 @@

Changelog

+
8.4
+
Added light/dark theme detection for badge background color (#61)
+
Enabled to run with "controlled_by_other_extensions" on Firefox (#68)
+
Removed localhost & local network passthrough in Firefox (#50, #63, #64, #66, #71)
+
Updated Options save process to fill blank proxy header title display (#74)
8.3
Added enterprise policy & managed storage feature (#42) (experimental)
@@ -27,7 +32,6 @@

Changelog

Updated PAC check to allow "file:" (#49)
Updated user interface to disable inapplicable options in proxies
-
8.2
Added option to set the country to blank
Fixed an issue with upgrade sync data on Chrome (#45)
diff --git a/src/content/action.js b/src/content/action.js index 3a26f84..5a61e3d 100644 --- a/src/content/action.js +++ b/src/content/action.js @@ -2,11 +2,14 @@ import {Location} from './location.js'; export class Action { + // https://github.com/w3c/webextensions/issues/72#issuecomment-1848874359 + // 'prefers-color-scheme' detection in Chrome background service worker + static dark = false; static set(pref) { // --- set action/browserAction let title = '', text = ''; - let color = '#fff'; + let color = this.dark ? '#444' : '#fff'; switch (pref.mode) { case 'disable': title = browser.i18n.getMessage('disable'); diff --git a/src/content/default.css b/src/content/default.css index 094f991..d42ea56 100644 --- a/src/content/default.css +++ b/src/content/default.css @@ -102,7 +102,8 @@ button:hover { background: var(--btn-hover); } -button:disabled { +button:disabled, +select:disabled { cursor: not-allowed; opacity: 0.4; } diff --git a/src/content/help.html b/src/content/help.html index 586ce6c..bdf38bb 100644 --- a/src/content/help.html +++ b/src/content/help.html @@ -283,14 +283,14 @@

Global Exclude

Proxy by Patterns browser FoxyProxy
scheme, host, wildcard, CIDR (IPv4) - FoxyProxy + FoxyProxy FoxyProxy
scheme, host, wildcard, CIDR (IPv4) Single Proxy browser browser
scheme, host, wildcard, CIDR - FoxyProxy + FoxyProxy FoxyProxy
scheme, host, wildcard, CIDR (IPv4) @@ -304,21 +304,21 @@

Global Exclude

Incognito browser browser
scheme, host, wildcard, CIDR - FoxyProxy + FoxyProxy FoxyProxy
scheme, host, wildcard, CIDR (IPv4) Container n/a n/a - FoxyProxy + FoxyProxy FoxyProxy
scheme, host, wildcard, CIDR (IPv4) Tab Proxy n/a n/a - FoxyProxy + FoxyProxy FoxyProxy
scheme, host, wildcard, CIDR (IPv4) diff --git a/src/content/on-request.js b/src/content/on-request.js index 33ed028..0943238 100644 --- a/src/content/on-request.js +++ b/src/content/on-request.js @@ -139,7 +139,7 @@ export class OnRequest { // ---------- passthrough -------------------------------- static bypass(url) { switch (true) { - case this.localhost(url): // localhost passthrough + // case this.localhost(url): // localhost passthrough case this.passthrough.some(i => new RegExp(i, 'i').test(url)): // global passthrough case this.net[0] && this.isInNet(url): // global passthrough CIDR return true; diff --git a/src/content/options.js b/src/content/options.js index 1983a97..74acd42 100644 --- a/src/content/options.js +++ b/src/content/options.js @@ -249,6 +249,12 @@ class Options { return; } + // --- title check + if (!obj.title) { + const id = obj.type === 'pac' ? obj.pac : `${obj.hostname}:${obj.port}`; + elem.children[0].children[1].textContent = id; + } + // --- check store locally for active PAC if (obj.active && obj.pac) { const storeLocally = elem.querySelector('.pac input[type="checkbox"]'); diff --git a/src/content/popup.html b/src/content/popup.html index c52ee16..087d853 100644 --- a/src/content/popup.html +++ b/src/content/popup.html @@ -29,7 +29,7 @@

- diff --git a/src/content/popup.js b/src/content/popup.js index 332722d..f8fd121 100644 --- a/src/content/popup.js +++ b/src/content/popup.js @@ -87,9 +87,12 @@ class Popup { if (mode === pref.mode) { return; } // disregard re-click if (pref.managed) { return; } // not for storage.managed + // check 'prefers-color-scheme' since it is not available in background service worker + const dark = window.matchMedia('(prefers-color-scheme: dark)').matches; + pref.mode = mode; browser.storage.local.set({mode}); // save mode - browser.runtime.sendMessage({id: 'setProxy', pref}); + browser.runtime.sendMessage({id: 'setProxy', pref, dark}); } static processButtons(e) { diff --git a/src/content/proxy.js b/src/content/proxy.js index 7577244..c98458f 100644 --- a/src/content/proxy.js +++ b/src/content/proxy.js @@ -21,9 +21,10 @@ export class Proxy { } static onMessage(message) { - const {id, pref, host, proxy} = message; + const {id, pref, host, proxy, dark} = message; switch (id) { case 'setProxy': + Action.dark = dark; this.set(pref); break; @@ -62,9 +63,9 @@ export class Proxy { const path = control ? `/image/icon.${ext}` : `/image/icon-off.${ext}`; browser.action.setIcon({path}); - if (!control) { + if (!App.firefox && !control) { browser.action.setTitle({title: browser.i18n.getMessage('controlledByOtherExtensions')}); - browser.action.setBadgeText({text: '❌'}); + // browser.action.setBadgeText({text: '❌'}); return null; } @@ -131,6 +132,7 @@ export class Proxy { value.proxyType = 'system'; } + // no error if levelOfControl: "controlled_by_other_extensions" browser.proxy.settings.set({value}); }