diff --git a/src/assets/images/instructables-icon.svg b/src/assets/images/instructables-icon.svg new file mode 100644 index 0000000..9b7eaa2 --- /dev/null +++ b/src/assets/images/instructables-icon.svg @@ -0,0 +1,372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 3ff1159..4613d34 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -56,26 +56,20 @@ function redirect(url, type, initiator, forceRedirection) { for (const service in config.services) { if (!forceRedirection && !options[service].enabled) continue - frontend = options[service] + frontend = options[service].frontend + if ( config.services[service].embeddable && - type != options[service].redirectType && - options[service].redirectType != "both" + type != options[service].redirectType && options[service].redirectType != "both" ) { if (options[service].unsupportedUrls == 'block') return 'CANCEL' return } - if ( - config.services[service].embeddable - && - type != "main_frame" - && - options[service].redirectType != "main_frame" - && - options[service].embedFrontend != "disabled" - ) frontend = options[service].embedFrontend - + if (config.services[service].frontends[frontend].desktopApp && type != "main_frame" && options[service].redirectType != "main_frame") + frontend = options[service].embedFrontend + + if (!regexArray(service, url, config, frontend)) { frontend = null continue @@ -729,7 +723,8 @@ const defaultInstances = { "libreSpeed": ['https://librespeed.org'], 'jitsi': ['https://meet.jit.si', 'https://8x8.vc'], 'binternet': ['https://binternet.ahwx.org'], - 'pixivFe': ['https://pixivfe.exozy.me'] + 'pixivFe': ['https://pixivfe.exozy.me'], + 'indestructables': ['https://indestructables.private.coffee'] } function initDefaults() { diff --git a/src/config.json b/src/config.json index 9659bc8..ee6a62d 100644 --- a/src/config.json +++ b/src/config.json @@ -99,7 +99,7 @@ "enabled": false, "redirectType": "main_frame", "frontend": "invidious", - "embedFrontend": "disabled", + "embedFrontend": "invidious", "unsupportedUrls": "bypass" }, "imageType": "png", @@ -783,26 +783,6 @@ "imageType": "svg", "url": "https://gitlab.com/" }, - "wolframAlpha": { - "frontends": { - "wolfreeAlpha": { - "name": "WolfreeAlpha", - "instanceList": true, - "url": "https://git.disroot.org/wolfree" - } - }, - "targets": [ - "^https?:\\/{2}(www\\.)?wolframalpha\\.com\\/" - ], - "name": "Wolfram Alpha", - "options": { - "enabled": false, - "unsupportedUrls": "bypass", - "frontend": "wolfreeAlpha" - }, - "imageType": "svg", - "url": "https://www.wolframalpha.com" - }, "speedTest": { "frontends": { "libreSpeed": { @@ -825,6 +805,26 @@ "imageType": "svgMono", "url": "https://speedtest.libredirect.invalid" }, + "instructables": { + "name": "Instructables", + "frontends": { + "indestructables": { + "name": "Indestructables", + "instanceList": true, + "url": "https://indestructables.codeberg.page" + } + }, + "targets": [ + "^https?:\\/{2}(www\\.)?instructables\\.com\\/" + ], + "options": { + "enabled": false, + "unsupportedUrls": "bypass", + "frontend": "indestructables" + }, + "imageType": "svg", + "url": "https://www.instructables.com" + }, "meet": { "name": "Meet", "frontends": { @@ -844,6 +844,26 @@ }, "imageType": "svgMono", "url": "https://meet.libredirect.invalid" + }, + "wolframAlpha": { + "frontends": { + "wolfreeAlpha": { + "name": "WolfreeAlpha", + "instanceList": true, + "url": "https://git.disroot.org/wolfree" + } + }, + "targets": [ + "^https?:\\/{2}(www\\.)?wolframalpha\\.com\\/" + ], + "name": "Wolfram Alpha", + "options": { + "enabled": false, + "unsupportedUrls": "bypass", + "frontend": "wolfreeAlpha" + }, + "imageType": "svg", + "url": "https://www.wolframalpha.com" } } } \ No newline at end of file diff --git a/src/pages/options/index.js b/src/pages/options/index.js index cf0fb03..2cf525e 100644 --- a/src/pages/options/index.js +++ b/src/pages/options/index.js @@ -56,20 +56,31 @@ async function changeFrontendsSettings(service) { } if (document.getElementById(`${service}-redirectType`)) { const frontend = options[service].frontend - if (config.services[service].frontends[frontend].embeddable || config.services[service].frontends[frontend].desktopApp) { + if (config.services[service].frontends[frontend].embeddable) { document.getElementById(`${service}-redirectType`).innerHTML = ` ` - document.getElementById(`${service}-redirectType`).value = options[service].redirectType + } + else if (config.services[service].frontends[frontend].desktopApp && Object.values(config.services[service].frontends).some(frontend => frontend.embeddable)) { + document.getElementById(`${service}-redirectType`).innerHTML = ` + + ` + if (options[service].redirectType == "sub_frame") { + options[service].redirectType = "main_frame" + browser.storage.local.set({ options }) + } } else { document.getElementById(`${service}-redirectType`).innerHTML = '' options[service].redirectType = "main_frame" + browser.storage.local.set({ options }) } - if (config.services[service].frontends[frontend].desktopApp) { + document.getElementById(`${service}-redirectType`).value = options[service].redirectType + if (config.services[service].frontends[frontend].desktopApp && options[service].redirectType != "main_frame") { document.getElementById(`${service}-embedFrontend-div`).style.display = '' } else { document.getElementById(`${service}-embedFrontend-div`).style.display = 'none' diff --git a/src/pages/options/widgets/services.pug b/src/pages/options/widgets/services.pug index 64830cc..d710ed7 100644 --- a/src/pages/options/widgets/services.pug +++ b/src/pages/options/widgets/services.pug @@ -37,7 +37,6 @@ each val, service in services div(id=service+"-embedFrontend-div" class="some-block option-block") h4(data-localise="__MSG_embedFrontend__") Embed Frontend select(id=service+"-embedFrontend") - option(value="disabled") Disabled each val, frontend in services[service].frontends if services[service].frontends[frontend].embeddable && services[service].frontends[frontend].instanceList option(value=frontend)=services[service].frontends[frontend].name diff --git a/src/pages/stylesheets/styles.css b/src/pages/stylesheets/styles.css index 875763d..fb246b7 100644 --- a/src/pages/stylesheets/styles.css +++ b/src/pages/stylesheets/styles.css @@ -128,7 +128,7 @@ section.links { flex-wrap: wrap; flex-direction: column; width: 300px; - max-height: 800px; + max-height: 850px; } section.links div {