-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.js
34 lines (28 loc) · 949 Bytes
/
init.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
/**
* Inject menu.html into page and create <script> tags containing all scripts
**/
fetch(chrome.runtime.getURL('/menu.html')).then(r => r.text()).then(html => {
document.querySelector("#wrapper").insertAdjacentHTML('beforeend', html);
const scripts = [
"utils.js",
"libs/reef.min.js",
"menu.js",
"builder/actions.js",
"builder/builder.js",
"captcha-notifier.js",
"automation/healing.js",
"automation/fight.js",
"automation/farming.js"
];
for (const filename of scripts) {
var s = document.createElement('script');
s.src = chrome.runtime.getURL(filename);
s.onload = function () {
this.remove();
};
(document.head || document.documentElement).appendChild(s);
}
window.addEventListener("PassToBackground", function (evt) {
chrome.runtime.sendMessage(evt.detail);
}, false);
});