-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontentScript.js
28 lines (27 loc) · 1.1 KB
/
contentScript.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
// contentScript.js
if (window.location.href.includes('namemc.com/boost/badges')) {
executeScript('web-pages/addBadgesPAGES.js');
}
else if (window.location.href.includes('namemc.com/badges/all_minecon_capes')) {
executeScript('web-pages/addAllMineconCapesPAGES.js');
}
else if (window.location.href.includes('namemc.com/badges/supporter')) {
executeScript('web-pages/addSupporterPAGES.js');
}
else if (window.location.href.includes('namemc.com/badges/beta_account')) {
executeScript('web-pages/addBetaAccountPAGES.js');
}
else if (window.location.href.includes('namemc.com/badges/classic_account')) {
executeScript('web-pages/addClassicAccountPAGES.js');
}
else if (window.location.href.includes('namemc.com/badges/indev_account')) {
executeScript('web-pages/addIndevAccountPAGES.js');
}
function executeScript(scriptPath) {
var script = document.createElement('script');
script.src = chrome.runtime.getURL(scriptPath);
script.onload = function() {
this.remove(); // delete script to free space
};
(document.head || document.documentElement).appendChild(script);
}