Added communication to Frontends Manager. 2.5.4 => 2.6.0

This commit is contained in:
ManeraKai 2023-05-19 15:38:04 +03:00
parent 00dadbe766
commit 12dd59e290
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337
4 changed files with 19 additions and 14 deletions

View File

@ -9,6 +9,7 @@ function init() {
return new Promise(async resolve => { return new Promise(async resolve => {
options = await utils.getOptions() options = await utils.getOptions()
config = await utils.getConfig() config = await utils.getConfig()
await sendEnabledFrontends()
resolve() resolve()
}) })
} }
@ -16,16 +17,20 @@ function init() {
init() init()
browser.storage.onChanged.addListener(init) browser.storage.onChanged.addListener(init)
// function sendEnabledFrontends() { function sendEnabledFrontends() {
// return new Promise(resolve => { let enabledFrontends = []
// console.log('sendEnabledFrontends') if (options) {
// let enabledFrontends = [] for (const service in config.services) {
// for (const service in config.services) { if (!options[service].enabled) continue
// if (!options[service].enabled) continue enabledFrontends.push(options[service].frontend)
// 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) { function all(service, frontend, options, config) {
let instances = [] let instances = []

View File

@ -1,7 +1,7 @@
{ {
"name": "__MSG_extensionName__", "name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__", "description": "__MSG_extensionDescription__",
"version": "2.5.4", "version": "2.6.0",
"manifest_version": 2, "manifest_version": 2,
"browser_specific_settings": { "browser_specific_settings": {
"gecko": { "gecko": {
@ -28,7 +28,8 @@
"<all_urls>" "<all_urls>"
], ],
"optional_permissions": [ "optional_permissions": [
"bookmarks" "bookmarks",
"nativeMessaging"
], ],
"browser_action": { "browser_action": {
"default_title": "__MSG_extensionName__", "default_title": "__MSG_extensionName__",

View File

@ -85,7 +85,6 @@ async function loadPage(path) {
} }
for (const service in config.services) { for (const service in config.services) {
console.log(service, options[service].enabled)
if (options[service].enabled) { if (options[service].enabled) {
document.getElementById(`${service}-link`).style.opacity = 1 document.getElementById(`${service}-link`).style.opacity = 1
} else { } else {

View File

@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'> <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='oladmjdebphlnjjcnomfhhbfdldiimaf'> <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> </app>
</gupdate> </gupdate>