-
Notifications
You must be signed in to change notification settings - Fork 1
/
background.js
22 lines (20 loc) · 885 Bytes
/
background.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// this is the background code...
// listen for our browerAction to be clicked
// chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
// chrome.tabs.executeScript(null, { file: "jquery-3.3.1.min.js" }, function() {
// chrome.tabs.executeScript(null, { file: "content.js" });
// });
var s = document.createElement('script');
s.src = chrome.extension.getURL("content.js");
s.onload = function() {
this.parentNode.removeChild(this);
};
// var b = document.createElement('script');
// b.src = chrome.extension.getURL("jquery-3.3.1.min.js");
// b.onload = function() {
// this.parentNode.removeChild(this);
// };
(document.head||document.documentElement).appendChild(s);
// (document.head||document.documentElement).appendChild(b);
// });