mirror of
https://github.com/FranP-code/wii-shop-extension.git
synced 2025-10-12 23:52:52 +00:00
Stop music playback on popup close, if possible
This commit is contained in:
@@ -57,6 +57,16 @@ chrome.tabs.onActivated.addListener(function (activeInfo) {
|
||||
})
|
||||
})
|
||||
|
||||
// Listen for pause/play commands from popup
|
||||
chrome.runtime.onMessage.addListener(function (request) {
|
||||
if (request === 'pause') {
|
||||
themeAudio.src = ''
|
||||
} else if (request === 'play') {
|
||||
themeAudio.src = currentMusic
|
||||
themeAudio.play()
|
||||
}
|
||||
})
|
||||
|
||||
// Show notification on extension install
|
||||
chrome.runtime.onInstalled.addListener(function () {
|
||||
// Set most options
|
||||
|
||||
Reference in New Issue
Block a user