-
Notifications
You must be signed in to change notification settings - Fork 0
/
injector.js
40 lines (31 loc) · 1.05 KB
/
injector.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
injected_scripts = [
'convergence/rxjs.umd.min.js',
'convergence/convergence.global.min.js',
'convergence/convergence-input-element-bindings.min.js',
'ace-collab-ext/AceCursorMarker.js',
'ace-collab-ext/AceMultiCursorManager.js',
'ace-collab-ext/AceMultiSelectionManager.js',
'ace-collab-ext/AceRadarView.js',
'ace-collab-ext/AceRadarViewIndicator.js',
'ace-collab-ext/AceRangeUtil.js',
'ace-collab-ext/AceSelectionMarker.js',
'ace-collab-ext/AceViewportUtil.js',
'AceBinder.js',
'inject.js'
];
injected_scripts.forEach(script_uri => {
// console.log(script_uri);
if (!("PRLVE_INJECTED_SCRIPTS" in window)) {
window.PRLVE_INJECTED_SCRIPTS = {};
}
if (script_uri in window.PRLVE_INJECTED_SCRIPTS) {
return;
}
window.PRLVE_INJECTED_SCRIPTS[script_uri] = true;
let s = document.createElement('script');
s.src = chrome.runtime.getURL(script_uri);
s.onload = function() {
this.remove();
};
(document.head || document.documentElement).appendChild(s);
});