From 229630d345e1a9c72c952a1dbe93a71a243c2c02 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sun, 21 May 2023 19:29:45 +0300 Subject: [PATCH] Small fixes --- src/assets/javascripts/services.js | 12 +++++------- src/config.json | 7 ++++--- src/manifest.json | 3 +-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 6ac16a0..99ecfdc 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -9,7 +9,7 @@ function init() { return new Promise(async resolve => { options = await utils.getOptions() config = await utils.getConfig() - await sendEnabledFrontends() + // await sendEnabledFrontends() resolve() }) } @@ -24,11 +24,9 @@ function sendEnabledFrontends() { 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() - } + var port = browser.runtime.connectNative("org.libredirect.stdin_parser"); + port.postMessage(JSON.stringify(enabledFrontends)); + port.disconnect() } } @@ -48,7 +46,7 @@ function all(service, frontend, options, config) { function regexArray(service, url, config, frontend) { let targetList = config.services[service].targets - if (frontend && config.services[service].frontends[frontend].excludeTargets) { + if (frontend && 'excludeTargets' in config.services[service].frontends[frontend]) { targetList = targetList.filter(val => !config.services[service].frontends[frontend].excludeTargets.includes(targetList.indexOf(val)) ) diff --git a/src/config.json b/src/config.json index 013a6d2..90b55f9 100644 --- a/src/config.json +++ b/src/config.json @@ -216,7 +216,8 @@ "name": "rimgo", "instanceList": true, "url": "https://codeberg.org/video-prize-ranch/rimgo", - "localhost": true + "localhost": true, + "embeddable": true } }, "targets": [ @@ -311,7 +312,7 @@ } }, "targets": [ - "^https?:\\/{2}(?:www\\.|m\\.|)imdb\\.com\\/title" + "^https?:\\/{2}(?:www\\.|m\\.|)imdb\\.com" ], "name": "IMDb", "options": { @@ -765,7 +766,7 @@ "targets": [ "^https?:\\/{2}(www\\.)?wolframalpha\\.com\\/" ], - "name": "WolframAlpha", + "name": "Wolfram Alpha", "options": { "enabled": false, "unsupportedUrls": "bypass", diff --git a/src/manifest.json b/src/manifest.json index 646c11f..f97ba5a 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -28,8 +28,7 @@ "" ], "optional_permissions": [ - "bookmarks", - "nativeMessaging" + "bookmarks" ], "browser_action": { "default_title": "__MSG_extensionName__",