Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed May 21, 2023
1 parent 12dd59e commit 229630d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
12 changes: 5 additions & 7 deletions src/assets/javascripts/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function init() {
return new Promise(async resolve => {
options = await utils.getOptions()
config = await utils.getConfig()
await sendEnabledFrontends()
// await sendEnabledFrontends()
resolve()
})
}
Expand All @@ -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()
}
}

Expand All @@ -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))
)
Expand Down
7 changes: 4 additions & 3 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@
"name": "rimgo",
"instanceList": true,
"url": "https://codeberg.org/video-prize-ranch/rimgo",
"localhost": true
"localhost": true,
"embeddable": true
}
},
"targets": [
Expand Down Expand Up @@ -311,7 +312,7 @@
}
},
"targets": [
"^https?:\\/{2}(?:www\\.|m\\.|)imdb\\.com\\/title"
"^https?:\\/{2}(?:www\\.|m\\.|)imdb\\.com"
],
"name": "IMDb",
"options": {
Expand Down Expand Up @@ -765,7 +766,7 @@
"targets": [
"^https?:\\/{2}(www\\.)?wolframalpha\\.com\\/"
],
"name": "WolframAlpha",
"name": "Wolfram Alpha",
"options": {
"enabled": false,
"unsupportedUrls": "bypass",
Expand Down
3 changes: 1 addition & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"<all_urls>"
],
"optional_permissions": [
"bookmarks",
"nativeMessaging"
"bookmarks"
],
"browser_action": {
"default_title": "__MSG_extensionName__",
Expand Down

0 comments on commit 229630d

Please sign in to comment.