Skip to content

Commit 037b2a6

Browse files
committed
Update
1 parent f3fed12 commit 037b2a6

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

background.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,12 @@ async function restoreOptions(tab) {
3131
storage.customOptions.forEach((element) => {
3232
if (matchRuleShort(url, element.url)) { // Compare custom setting's hostname with the tab's
3333
injected = true;
34-
if(element.shadowActivated) { // If the settings has text shadow activated
35-
css = '::selection { background: ' + element.background + ' !important; color: ' + element.color + ' !important; text-shadow: ' + element.shadowColor + ' 0px 0px ' + element.shadowBlur + 'px !important}';
36-
} else {
37-
css = '::selection { background: ' + element.background + ' !important; color: ' + element.color + ' !important; text-shadow: none !important}';
38-
}
34+
css = '::selection { background: ' + element.background + ' !important; color: ' + element.color + ((element.shadowActivated) ? ' !important; text-shadow: ' + element.shadowColor + ' 0px 0px ' + element.shadowBlur + 'px !important' : '') + '}';
3935
}
4036
});
4137
}
4238
if (!injected && storage.witness) { // If url didn't match any custom settings and the user already defined some settings (avoid injecting undefined values into CSS)
43-
if(storage.shadowActivated) { // If the settings has text shadow activated
44-
css = '::selection { background: ' + storage.background_color + ' !important; color: ' + storage.color + ' !important; text-shadow: ' + storage.shadowColor + ' 0px 0px ' + storage.shadowBlur + 'px !important}';
45-
} else {
46-
css = '::selection { background: ' + storage.background_color + ' !important; color: ' + storage.color + ' !important; text-shadow: none !important}';
47-
}
39+
css = '::selection { background: ' + storage.background_color + ' !important; color: ' + storage.color + ((storage.shadowActivated) ? ' !important; text-shadow: ' + storage.shadowColor + ' 0px 0px ' + storage.shadowBlur + 'px !important' : '') + '}';
4840
}
4941
browser.scripting.insertCSS({
5042
target: {

0 commit comments

Comments
 (0)