Added communication to Frontends Manager. 2.5.4 => 2.6.0
This commit is contained in:
parent
00dadbe766
commit
12dd59e290
@ -9,6 +9,7 @@ function init() {
|
||||
return new Promise(async resolve => {
|
||||
options = await utils.getOptions()
|
||||
config = await utils.getConfig()
|
||||
await sendEnabledFrontends()
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
@ -16,16 +17,20 @@ function init() {
|
||||
init()
|
||||
browser.storage.onChanged.addListener(init)
|
||||
|
||||
// function sendEnabledFrontends() {
|
||||
// return new Promise(resolve => {
|
||||
// console.log('sendEnabledFrontends')
|
||||
// let enabledFrontends = []
|
||||
// for (const service in config.services) {
|
||||
// if (!options[service].enabled) continue
|
||||
// enabledFrontends.push(options[service].frontend)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
function sendEnabledFrontends() {
|
||||
let enabledFrontends = []
|
||||
if (options) {
|
||||
for (const service in config.services) {
|
||||
if (!options[service].enabled) continue
|
||||
enabledFrontends.push(options[service].frontend)
|
||||
}
|
||||
if (enabledFrontends.length > 0) {
|
||||
var port = browser.runtime.connectNative("org.libredirect.stdin_parser");
|
||||
port.postMessage(enabledFrontends);
|
||||
port.disconnect()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function all(service, frontend, options, config) {
|
||||
let instances = []
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "__MSG_extensionName__",
|
||||
"description": "__MSG_extensionDescription__",
|
||||
"version": "2.5.4",
|
||||
"version": "2.6.0",
|
||||
"manifest_version": 2,
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
@ -28,7 +28,8 @@
|
||||
"<all_urls>"
|
||||
],
|
||||
"optional_permissions": [
|
||||
"bookmarks"
|
||||
"bookmarks",
|
||||
"nativeMessaging"
|
||||
],
|
||||
"browser_action": {
|
||||
"default_title": "__MSG_extensionName__",
|
||||
|
@ -85,7 +85,6 @@ async function loadPage(path) {
|
||||
}
|
||||
|
||||
for (const service in config.services) {
|
||||
console.log(service, options[service].enabled)
|
||||
if (options[service].enabled) {
|
||||
document.getElementById(`${service}-link`).style.opacity = 1
|
||||
} else {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||
<app appid='oladmjdebphlnjjcnomfhhbfdldiimaf'>
|
||||
<updatecheck codebase='https://github.com/libredirect/libredirect/releases/download/v2.5.4/libredirect-2.5.4.crx' version='2.5.4' />
|
||||
<updatecheck codebase='https://github.com/libredirect/libredirect/releases/download/v2.6.0/libredirect-2.6.0.crx' version='2.6.0' />
|
||||
</app>
|
||||
</gupdate>
|
||||
|
Loading…
x
Reference in New Issue
Block a user