move audio playback to background page to avoid the page's own CSP interfering

This commit is contained in:
wareya committed 2019-04-05 07:34:54 -04:00
1 parent f982de54d3
commit 8317f44270
3 files changed
+10 -17

No files matched your search

+8
View File
@@ -1452,6 +1452,14 @@ browser.runtime.onMessage.addListener((req, sender) =>
});
xhr.send(req.command);
}
else if (req.type == "play_audio")
{
let audio = new Audio(req.host);
audio.volume = req.volume;
audio.play();
console.log("tried to play audio");
console.log(req.host);
}
return Promise.resolve(undefined);
});