Added communication to Frontends Manager. 2.5.4 => 2.6.0

このコミットが含まれているのは:
ManeraKai 2023-05-19 15:38:04 +03:00
コミット 12dd59e290
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 5ABC31FFD562E337
4個のファイルの変更19行の追加14行の削除

ファイルの表示

@ -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>