-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackground.js
32 lines (30 loc) · 1.11 KB
/
background.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
let theme_names = [
"classic",
"dark_teal",
"african_morning",
"neon_bar",
"claybricks_area",
"twilight_wizard"
];
chrome.runtime.onInstalled.addListener(function() {
chrome.storage.sync.get("theme", function (opt) {
let theme = opt.theme;
if (theme > 0) {
chrome.scripting.registerContentScripts([{
id: "content-scripts",
matches: ["https://orioks.miet.ru/*"],
excludeMatches: ["https://orioks.miet.ru/moodle/*"],
js: ["js/main.js", "js/" + theme_names[theme] + ".js"],
css: ["assets/css/main.css", "assets/css/" + theme_names[theme] + ".css", "assets/css/beaty_navbar.css"]
}]);
} else {
chrome.scripting.registerContentScripts([{
id: "content-scripts",
matches: ["https://orioks.miet.ru/*"],
excludeMatches: ["https://orioks.miet.ru/moodle/*"],
js: ["js/classic.js"],
css: ["assets/css/classic.css"]
}]);
}
});
});