-
Notifications
You must be signed in to change notification settings - Fork 11
/
background.html
39 lines (36 loc) · 968 Bytes
/
background.html
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
<script>
/*
* Copyright (C) 2011 Thomas Dvornik
* All rights reserved.
*
*/
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.sendRequest(tab.id, {browserAction: "clicked"}, function(response) {
if (response.error == "load") {
chrome.tabs.insertCSS(null, {
file : "boxes.css"
});
chrome.tabs.executeScript(null, {
file : "XPathBox.js"
});
chrome.tabs.executeScript(null, {
file : "ElementContainer.js"
});
chrome.tabs.executeScript(null, {
file : "main.js"
});
}
});
});
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
if (request.att == 'get') {
sendResponse({val: localStorage[request.param]});
}
else if (request.att == 'set') {
localStorage[request.param] = request.val;
sendResponse({});
}
else
sendResponse({}); // snub them.
});
</script>