Merge branch 'master' into popular-dutch-webshops

This commit is contained in:
Corbin Davenport
2021-03-08 13:41:14 -05:00
committed by GitHub
2 changed files with 36 additions and 1 deletions

View File

@@ -31,6 +31,21 @@ chrome.tabs.onUpdated.addListener(function (tabId, changeInfo) {
})
})
// Detect shopping tab becoming inactive/closed, if the domain matches a shopping site, play music
chrome.tabs.onActivated.addListener(function(activeInfo) {
chrome.tabs.get(activeInfo.tabId, function(tab) {
var url = new URL(tab.url)
var domain = url.hostname.toString().replace('www.','')
console.log(domain)
if (!siteList.includes(domain)) {
themeAudio.pause()
}
else {
themeAudio.play()
}
})
})
// Show notification on extension install
chrome.runtime.onInstalled.addListener(function() {
chrome.notifications.create({
@@ -39,4 +54,4 @@ chrome.runtime.onInstalled.addListener(function() {
'title': 'Wii Shop Music extension installed!',
'message': 'The Wii Shop theme will now play when you visit shopping websites.'
})
})
})

View File

@@ -13,8 +13,24 @@ const siteList = [
'amazon.nl',
'amazon.es',
'amazon.co.uk',
'smile.amazon.co.uk',
'smile.amazon.com',
'smile.amazon.com.au',
'smile.amazon.com.br',
'smile.amazon.ca',
'smile.amazon.cn',
'smile.amazon.fr',
'smile.amazon.de',
'smile.amazon.in',
'smile.amazon.it',
'smile.amazon.co.jp',
'smile.amazon.com.mx',
'smile.amazon.nl',
'smile.amazon.es',
'smile.amazon.co.uk',
'bestbuy.com',
'bhphotovideo.com',
'canadacomputers.com',
'ebay.com',
'ebay.com.au',
'ebay.at',
@@ -33,7 +49,10 @@ const siteList = [
'etsy.com',
'walmart.com',
'maycs.com',
'staples.com',
'staples.ca',
'swappa.com',
'system76.com',
'target.com',
'aliexpress.com',
'newegg.com',
@@ -47,4 +66,5 @@ const siteList = [
'azerty.nl',
'marktplaats.nl',
'mediamarkt.nl',
'zehrs.ca'
]