-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
executable file
·35 lines (28 loc) · 949 Bytes
/
main.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
function injectScript(file, node) {
var th = document.getElementsByTagName(node)[0];
var s = document.createElement('script');
s.setAttribute('type', 'text/javascript');
s.setAttribute('src', file);
th.appendChild(s);
}
function readInFile() {
var data = '';
$.getJSON(chrome.extension.getURL('resources/terms.json'), function( data ) {
return data;
});
}
//console.log(readInFile());
injectScript( chrome.extension.getURL('script.js'), 'body');
/*
$.getJSON("https://gist.githubusercontent.com/Fogest/29fca2c77a09d272ed7c/raw/7a34efdaabc8ca0a8078d2f83e2d0cab3de20276/terms.json",function(data) {
data = jQuery.parseJSON(data);
console.log(data);
chrome.storage.local.set({'terms': data}, function() {
// Notify that we saved.
console.log('Settings saved');
chrome.storage.local.get('terms', function (result) {
console.log(result.terms);
});
});
});
*/