Icon for dark/incognito mode (Chrome)
This commit is contained in:
parent
dba852ca46
commit
f7a631ab34
@ -840,6 +840,7 @@ function clear_cookies() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var chrome_scheme = 'light';
|
||||||
ext_api.runtime.onMessage.addListener(function (message, sender) {
|
ext_api.runtime.onMessage.addListener(function (message, sender) {
|
||||||
// check storage for opt in
|
// check storage for opt in
|
||||||
if (message.request === 'optin') {
|
if (message.request === 'optin') {
|
||||||
@ -866,6 +867,13 @@ ext_api.runtime.onMessage.addListener(function (message, sender) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (message.scheme && message.scheme !== chrome_scheme) {
|
||||||
|
let icon_path = {path: {'128': 'bypass.png'}};
|
||||||
|
if (message.scheme === 'dark')
|
||||||
|
icon_path = {path: {'128': 'bypass-dark.png'}};
|
||||||
|
ext_api.browserAction.setIcon(icon_path);
|
||||||
|
chrome_scheme = message.scheme;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// show the tab if we haven't registered the user reacting to the prompt.
|
// show the tab if we haven't registered the user reacting to the prompt.
|
||||||
|
BIN
bypass-dark.png
Normal file
BIN
bypass-dark.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 654 B |
@ -5,6 +5,7 @@ Post-release
|
|||||||
Add Deutsche Wirtschafts Nachrichten
|
Add Deutsche Wirtschafts Nachrichten
|
||||||
Add WirtschaftsWoche (Germany)
|
Add WirtschaftsWoche (Germany)
|
||||||
Fix-update Quartz (newsletter)
|
Fix-update Quartz (newsletter)
|
||||||
|
Icon for dark/incognito mode (Chrome)
|
||||||
|
|
||||||
* v1.9.2.0 (2020-10-25)
|
* v1.9.2.0 (2020-10-25)
|
||||||
Add Foreign Affairs
|
Add Foreign Affairs
|
||||||
|
@ -28,6 +28,13 @@ ext_api.runtime.onMessage.addListener(function (message, sender) {
|
|||||||
// ask for opt-in confirmation
|
// ask for opt-in confirmation
|
||||||
ext_api.runtime.sendMessage({request: 'optin'});
|
ext_api.runtime.sendMessage({request: 'optin'});
|
||||||
|
|
||||||
|
// message for dark or incognito mode (chrome)
|
||||||
|
if (typeof browser !== 'object')
|
||||||
|
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches || ext_api.extension.inIncognitoContext)
|
||||||
|
ext_api.runtime.sendMessage({scheme: 'dark'});
|
||||||
|
else
|
||||||
|
ext_api.runtime.sendMessage({scheme: 'light'});
|
||||||
|
|
||||||
// Content workarounds/domain
|
// Content workarounds/domain
|
||||||
|
|
||||||
if (matchDomain("thesaturdaypaper.com.au")) {
|
if (matchDomain("thesaturdaypaper.com.au")) {
|
||||||
|
@ -324,5 +324,5 @@
|
|||||||
"webRequest",
|
"webRequest",
|
||||||
"webRequestBlocking"
|
"webRequestBlocking"
|
||||||
],
|
],
|
||||||
"version": "1.9.2.2"
|
"version": "1.9.2.3"
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user