Adds some integration with firefox.

This is still rather unstable, but it runs.
This commit is contained in:
Markil3
2021-07-11 23:33:39 -06:00
parent 2bc005f031
commit 704ab06f85
535 changed files with 2381 additions and 23 deletions

29
add-on/background.js Normal file
View File

@@ -0,0 +1,29 @@
var port = browser.runtime.connectNative("universal_music")
/**
* Sends a message to the application
*/
function writeMessage(message)
{
port.postMessage(message)
}
/**
* Sends a message to the application
*/
function onAppMessage(message)
{
if ("command" in message)
{
switch (message["command"])
{
case "ping":
writeMessage({
"response": "ping"
});
break
}
}
}
port.onMessage.addListener(onAppMessage);