Skip to content

Commit

Permalink
Added communication to Frontends Manager. 2.5.4 => 2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed May 19, 2023
1 parent 00dadbe commit 12dd59e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
25 changes: 15 additions & 10 deletions src/assets/javascripts/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,28 @@ function init() {
return new Promise(async resolve => {
options = await utils.getOptions()
config = await utils.getConfig()
await sendEnabledFrontends()
resolve()
})
}

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 = []
Expand Down
5 changes: 3 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -28,7 +28,8 @@
"<all_urls>"
],
"optional_permissions": [
"bookmarks"
"bookmarks",
"nativeMessaging"
],
"browser_action": {
"default_title": "__MSG_extensionName__",
Expand Down
1 change: 0 additions & 1 deletion src/pages/options/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/updates/updates.xml
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 12dd59e

Please sign in to comment.