Files
UniversalMusicPlayer/add-on/background.js
Markil3 b89dd9783a Set up a callback system for the browser link.
This should somewhat simulate asynchronous method calling.
2021-07-26 22:53:44 -07:00

14 lines
315 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);
port.postMessage("pong");
});