-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackground.js
26 lines (23 loc) · 889 Bytes
/
background.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
// Perform the callback when a message is received from the content script
chrome.runtime.onMessage.addListener(function(message, sender) {
if (message.action == 'update icon') {
console.log('wutface')
chrome.pageAction.setIcon({
tabId: sender.tab.id,
path: "icons/wutface.png"
});
}
});
// Check whether new version is installed
chrome.runtime.onInstalled.addListener(function(details) {
if (details.reason == "install") {
console.log("This is a first install!");
var homepage_url = "https://github.com/RiTu1337/anti-scamaz";
chrome.tabs.create({
url: homepage_url
});
} else if (details.reason == "update") {
var thisVersion = chrome.runtime.getManifest().version;
console.log("Updated from " + details.previousVersion + " to " + thisVersion + "!");
}
});