forked from FrostCo/AdvancedProfanityFilter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheventPage.js
More file actions
19 lines (17 loc) · 744 Bytes
/
eventPage.js
File metadata and controls
19 lines (17 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Open options page if extension icon is clicked
chrome.browserAction.onClicked.addListener(function() {chrome.runtime.openOptionsPage();});
// Actions for extension install or upgrade
chrome.runtime.onInstalled.addListener(function(details){
if (details.reason == "install"){
chrome.runtime.openOptionsPage();
} else if (details.reason == "update") {
// var thisVersion = chrome.runtime.getManifest().version;
// console.log("Updated from " + details.previousVersion + " to " + thisVersion + "!");
}
});
// Show badge with number of words filtered
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
chrome.browserAction.setBadgeText({text: request.counter, tabId: sender.tab.id});
}
);