-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.js
More file actions
28 lines (24 loc) · 868 Bytes
/
Copy pathbootstrap.js
File metadata and controls
28 lines (24 loc) · 868 Bytes
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
// when the extension is first installed
chrome.runtime.onInstalled.addListener(function(details) {
localStorage["nope_installed"] = true;
});
// Listen for any changes to the URL of any tab.
// see: http://developer.chrome.com/extensions/tabs.html#event-onUpdated
chrome.tabs.onUpdated.addListener(function(id, info, tab){
if (tab.status !== "complete"){
console.log("not yet");
return;
}
if (tab.url.toLowerCase().indexOf("facebook.com") === -1){
console.log("not here");
return;
}
if (localStorage["nope_installed"] == "true"){
console.log("HI executing them script.");
chrome.tabs.executeScript(null, {"file": "nope.js"});
}
});
// show the popup when the user clicks on the page action.
chrome.pageAction.onClicked.addListener(function(tab) {
chrome.pageAction.show(tab.id);
});