-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackground.js
36 lines (35 loc) · 1015 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
27
28
29
30
31
32
33
34
35
36
/*chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
if (changeInfo.status === 'complete' ) {
if (tab.url.includes("/s/")){
chrome.scripting.executeScript({
target: { tabId: tabId },
files: ["./product.js"]
})
.then(() => {
console.log("etrekse to product script.");
})
.catch(err => console.log(err));
}
else if (tab.url.includes("/c/") || tab.url.includes("gr/search?")){
chrome.scripting.executeScript({
target: { tabId: tabId },
files: ["./search.js"]
})
.then(() => {
console.log("etrkse to search script.");
})
.catch(err => console.log(err));
}
else if (tab.url.includes("skroutz.gr/cart")){
chrome.scripting.executeScript({
target: { tabId: tabId },
files: ["./cart.js"]
})
.then(() => {
console.log("etrkse to cart script.");
})
.catch(err => console.log(err));
}
}
});
*/