Small fixes

This commit is contained in:
ManeraKai 2023-05-21 19:29:45 +03:00
parent 12dd59e290
commit 229630d345
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337
3 changed files with 10 additions and 12 deletions

View File

@ -9,7 +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() // await sendEnabledFrontends()
resolve() resolve()
}) })
} }
@ -24,13 +24,11 @@ function sendEnabledFrontends() {
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"); var port = browser.runtime.connectNative("org.libredirect.stdin_parser");
port.postMessage(enabledFrontends); port.postMessage(JSON.stringify(enabledFrontends));
port.disconnect() port.disconnect()
} }
} }
}
function all(service, frontend, options, config) { function all(service, frontend, options, config) {
let instances = [] let instances = []
@ -48,7 +46,7 @@ function all(service, frontend, options, config) {
function regexArray(service, url, config, frontend) { function regexArray(service, url, config, frontend) {
let targetList = config.services[service].targets 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 => targetList = targetList.filter(val =>
!config.services[service].frontends[frontend].excludeTargets.includes(targetList.indexOf(val)) !config.services[service].frontends[frontend].excludeTargets.includes(targetList.indexOf(val))
) )

View File

@ -216,7 +216,8 @@
"name": "rimgo", "name": "rimgo",
"instanceList": true, "instanceList": true,
"url": "https://codeberg.org/video-prize-ranch/rimgo", "url": "https://codeberg.org/video-prize-ranch/rimgo",
"localhost": true "localhost": true,
"embeddable": true
} }
}, },
"targets": [ "targets": [
@ -311,7 +312,7 @@
} }
}, },
"targets": [ "targets": [
"^https?:\\/{2}(?:www\\.|m\\.|)imdb\\.com\\/title" "^https?:\\/{2}(?:www\\.|m\\.|)imdb\\.com"
], ],
"name": "IMDb", "name": "IMDb",
"options": { "options": {

View File

@ -28,8 +28,7 @@
"<all_urls>" "<all_urls>"
], ],
"optional_permissions": [ "optional_permissions": [
"bookmarks", "bookmarks"
"nativeMessaging"
], ],
"browser_action": { "browser_action": {
"default_title": "__MSG_extensionName__", "default_title": "__MSG_extensionName__",