-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.js
More file actions
23 lines (20 loc) · 752 Bytes
/
background.js
File metadata and controls
23 lines (20 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
let ebayScripts = [];
function updateLocalStorage(scripts){
localStorage.setItem("total_scripts", scripts);
}
// set the scripts in localStorage.
chrome.runtime.onMessage.addListener(
function (request, sender, sendResponse) {
if(request.total_scripts){
ebayScripts = request.total_scripts;
updateLocalStorage(ebayScripts);
}
if (request.method == "updateLocalVariables") {
updateLocalStorage(ebayScripts);
}
}
);
// check valid ebay site.
const isEbaySite = (event) => {
return event.url && ((event.url.indexOf("ebay") > -1) || (event.url.indexOf('stags.bluekai.com') > -1) || (event.url.indexOf('about:blank') > -1) || (event.url.indexOf('c.paypal.com') > -1));
}