-
Notifications
You must be signed in to change notification settings - Fork 8
/
background_old.js
59 lines (34 loc) · 1.31 KB
/
background_old.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
class ContentScript {
static install() {
if (uDark.direct_window_export) {
[
dark_object.all_levels.install,
dark_object.content_script.override_website
].map(code => {
window.wrappedJSObject.eval("(" + code.toString() + ")()");
});
}
window.wrappedJSObject.uDark.userSettings = cloneInto({ // Preserve user privacy by not exporting sensible settings to the page
disable_cache: window.userSettings.disable_cache,
keep_service_workers:window.userSettings.keep_service_workers,
disable_image_edition: window.userSettings.disable_image_edition,
}, window);
window.wrappedJSObject.userSettingsReadyAction()
let myPort = globalThis.browser.runtime.connect({
name: "port-from-cs"
});
}
website_load() {
}
}
dark_object.all_levels.install();
dark_object.both.install()
if (globalThis.browser.webRequest) {
dark_object.background.install();
} else {
dark_object.content_script.install();
if (!uDark.direct_window_export) {
dark_object.content_script.override_website();
}
dark_object.content_script.website_load();
}