-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbackground.js
More file actions
36 lines (32 loc) · 1.13 KB
/
background.js
File metadata and controls
36 lines (32 loc) · 1.13 KB
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
// Called when the user clicks on the browser action.
chrome.browserAction.onClicked.addListener(function (tab) {
chrome.tabs.executeScript(null, {file: 'main.js'});
});
chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
//if(changeInfo.status === 'complete') {
if(tab.url.indexOf('galleryzerAutoOpen') !== -1) {
//chrome.tabs.executeScript(tabId, {file: 'main.js', runAt: 'document_end'});
}
//}
});
chrome.extension.onRequest.addListener(
function(request, sender, sendResponse) {
if (request.getSettings) {
//Defaults
var defaults = {
minWidth: 200,
background: 'dark',
findForumNav: true
};
//Load settings
chrome.storage.sync.get(defaults, function(items) {
sendResponse({
settings: {
minWidth: items.minWidth,
background: items.background,
findForumNav: items.findForumNav
}
});
});
}
});