Files
UniversalMusicPlayer/add-on/background.js
Markil3 66ce116da4 Added better logging and browser support.
We still need to work on the Linux browser a bit.
2021-07-26 20:27:43 -07:00

20 lines
468 B
JavaScript

console.log("Hello from Universal Music addon!")
/*
On startup, connect to the "ping_pong" app.
*/
var port = browser.runtime.connectNative("universalmusic");
/*
Listen for messages from the app.
*/
port.onMessage.addListener((response) => {
console.log("Received: " + response);
});
/*
On a click on the browser action, send the app a message.
*/
browser.browserAction.onClicked.addListener(() => {
console.log("Sending: ping");
port.postMessage("ping");
});