-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.js
More file actions
26 lines (23 loc) · 809 Bytes
/
background.js
File metadata and controls
26 lines (23 loc) · 809 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
//console.log('bg');
chrome.browserAction.onClicked.addListener(function(tab) {
console.log('icon click');
const r = chrome.tabs.query({active:true,windowType:"normal", currentWindow: true},
function(d){
console.log("TAB: " + d[0].id);
chrome.tabs.sendMessage(d[0].id, 'checkPricesParallel');
});
});
chrome.webNavigation.onCompleted.addListener(function callback(d) {
console.log('onCompleted ', d);
chrome.tabs.sendMessage(d.tabId, 'shopping');
},
{url: [{urlContains: 'banggood.com/shopping_cart.html'}
]}
);
chrome.webNavigation.onCompleted.addListener(function callback(d) {
console.log('on widhlist ', d);
chrome.tabs.sendMessage(d.tabId, 'wish');
},
{url: [{urlContains: 'https://www.banggood.com/index.php'}
]}
);