forked from hartleybrody/buzzkill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.js
29 lines (26 loc) · 910 Bytes
/
bootstrap.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
// when the extension is first installed
chrome.runtime.onInstalled.addListener(function(details) {
chrome.storage.sync.set({clean_news_feed: true});
});
// listen for any changes to the URL of any tab.
chrome.tabs.onUpdated.addListener(function(id, info, tab){
if (tab.url.toLowerCase().indexOf("facebook.com") > -1){
chrome.pageAction.show(tab.id);
}
});
// update the icon when the user's settings change
// chrome.storage.onChanged.addListener(function(changes, areaName){
// alert("changed settings");
// console.log("changed settings");
// if (localStorage["clean_news_feed"] == "true"){
// path = "active-icon.jpeg";
// } else {
// path = "inactive-icon.jpeg";
// }
// chrome.tabs.getCurrent( function(tab){
// chrome.pageAction.setIcon({
// "tabId": tab.id,
// "path": path
// });
// });
// });