Skip to content

Commit d92f071

Browse files
committed
disable modern scroll on sfgame.net; fixes #232
1 parent 44451c6 commit d92f071

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Chromium (.crx)/includes/modern_scroll.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ async function load_prefs() {
9494
last_dialog_time: 0,
9595
dialogs_shown: {}, // time : type
9696
saved_sets : {},
97-
custom_domains : {}
97+
custom_domains : {
98+
"sfgame.net": { "set": false }
99+
}
98100
}, storage => {
99101
w = storage;
100102

Chromium (.crx)/options/prefs.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ async function restorePrefs() {
155155
last_dialog_time: 0,
156156
dialogs_shown: {}, // time : type
157157
saved_sets : {},
158-
custom_domains : {}
158+
custom_domains : {
159+
"sfgame.net": { "set": false }
160+
}
159161
}, storage => {
160162
prefs = storage;
161163
document.body.style.accentColor = prefs.color;
@@ -416,7 +418,13 @@ function get_domain(url) {
416418

417419
async function enable_on_domain(domain) {
418420
chrome.storage.sync.get( { "custom_domains" : {} }, storage => {
419-
let custom_domains = storage.custom_domains;
421+
const custom_domains = storage.custom_domains;
422+
if (!custom_domains[domain]) {
423+
if (!window.location.href.includes("?domain="))
424+
window.location.href += "?domain=" + domain + "#disabled";
425+
return;
426+
}
427+
420428
delete prefs.custom_domains[domain]["set"];
421429
delete custom_domains[domain]["set"];
422430
chrome.storage.sync.set({ "custom_domains" : custom_domains });
@@ -428,7 +436,7 @@ async function enable_on_domain(domain) {
428436

429437
async function disable_on_domain(domain) {
430438
chrome.storage.sync.get( { "custom_domains" : {} }, storage => {
431-
let custom_domains = storage.custom_domains;
439+
const custom_domains = storage.custom_domains;
432440
if (!custom_domains.hasOwnProperty(domain)) custom_domains[domain] = {};
433441
custom_domains[domain]["set"] = false;
434442
chrome.storage.sync.set({ "custom_domains" : custom_domains });

0 commit comments

Comments
 (0)