Adds some integration with firefox.
This is still rather unstable, but it runs.
This commit is contained in:
29
add-on/background.js
Normal file
29
add-on/background.js
Normal 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);
|
||||
239
add-on/icon.svg
Normal file
239
add-on/icon.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 114 KiB |
7
add-on/intermediary_manifest.json
Normal file
7
add-on/intermediary_manifest.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "universal_music",
|
||||
"description": "A link between the Universal Music Player and the web browser.",
|
||||
"path": "${LINK_PATH}",
|
||||
"type": "stdio",
|
||||
"allowed_extensions": ["universal_music@regis.edu"]
|
||||
}
|
||||
30
add-on/manifest.json
Normal file
30
add-on/manifest.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"description": "An add-on to link the Universal Music Player to compatible web music players.",
|
||||
"manifest_version": 2,
|
||||
"name": "Universal Music Addon",
|
||||
"version": "0.1",
|
||||
"icons": {
|
||||
"16": "icon.svg",
|
||||
"32": "icon.svg",
|
||||
"64": "icon.svg",
|
||||
"128": "icon.svg",
|
||||
"256": "icon.svg",
|
||||
"512": "icon.svg"
|
||||
},
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "universal_music@regis.edu",
|
||||
"strict_min_version": "55.0"
|
||||
}
|
||||
},
|
||||
|
||||
"background": {
|
||||
"scripts": ["background.js"]
|
||||
},
|
||||
|
||||
"browser_action": {
|
||||
"default_icon": "icon.svg"
|
||||
},
|
||||
|
||||
"permissions": ["nativeMessaging"]
|
||||
}
|
||||
Reference in New Issue
Block a user