From 623aacfad2606d9d4df8357951a6299ffccc4930 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sat, 22 Jul 2023 13:14:35 +0300 Subject: [PATCH] Hopefully fixing https://github.com/libredirect/browser_extension/issues/765 --- src/assets/javascripts/services.js | 23 ++++------- src/config.json | 63 ++++++++++++++---------------- src/manifest.json | 2 +- 3 files changed, 38 insertions(+), 50 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index d0d85ac..0005770 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -58,13 +58,6 @@ function redirect(url, type, initiator, forceRedirection) { frontend = options[service].frontend - if ( - config.services[service].embeddable && - type != options[service].redirectType && options[service].redirectType != "both" - ) { - if (options[service].unsupportedUrls == 'block') return 'CANCEL' - return - } if (config.services[service].frontends[frontend].desktopApp && type != "main_frame" && options[service].redirectType != "main_frame") frontend = options[service].embedFrontend @@ -75,6 +68,14 @@ function redirect(url, type, initiator, forceRedirection) { continue } + if ( + config.services[service].embeddable && + type != options[service].redirectType && options[service].redirectType != "both" + ) { + if (options[service].unsupportedUrls == 'block') return 'CANCEL' + return + } + let instanceList = options[frontend] if (instanceList === undefined) break if (instanceList.length === 0) return null @@ -111,13 +112,6 @@ function redirect(url, type, initiator, forceRedirection) { if (!frontend) return switch (frontend) { - case "beatbump": { - return `${randomInstance}${url.pathname}${url.search}` - .replace("/watch?v=", "/listen?id=") - .replace("/channel/", "/artist/") - .replace("/playlist?list=", "/playlist/VL") - .replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/") + "?filter=all") - } case "hyperpipe": { return `${randomInstance}${url.pathname}${url.search}`.replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/")) } @@ -701,7 +695,6 @@ const defaultInstances = { 'lingva': ['https://lingva.ml'], 'searxng': ['https://search.bus-hit.me'], 'rimgo': ['https://rimgo.vern.cc'], - 'beatbump': ['https://beatbump.ml'], 'hyperpipe': ['https://hyperpipe.surge.sh'], 'facil': [' https://facilmap.org '], 'osm': ['https://www.openstreetmap.org'], diff --git a/src/config.json b/src/config.json index 0175002..3711bf4 100644 --- a/src/config.json +++ b/src/config.json @@ -108,11 +108,6 @@ }, "youtubeMusic": { "frontends": { - "beatbump": { - "name": "Beatbump", - "instanceList": true, - "url": "https://github.com/snuffyDev/Beatbump" - }, "hyperpipe": { "name": "Hyperpipe", "instanceList": true, @@ -120,12 +115,12 @@ } }, "targets": [ - "^https?:\\/{2}music\\.youtube\\.com(\\/|$)" + "^https?:\\/{2}music\\.youtube\\.com\\/" ], "name": "YT Music", "options": { "enabled": false, - "frontend": "beatbump", + "frontend": "hyperpipe", "unsupportedUrls": "bypass" }, "imageType": "png", @@ -141,11 +136,11 @@ "localhost": true } }, - "targets": [ - "^https?:\\/{2}(www\\.|mobile\\.)?twitter\\.com(\\/|$)", - "^https?:\\/{2}(pbs\\.|video\\.)twimg\\.com(\\/|$)", - "^https?:\\/{2}platform\\.twitter\\.com/embed(\\/|$)", - "^https?:\\/{2}t\\.co(\\/|$)" + "targets": [ + "^https?:\\/{2}(www\\.|mobile\\.)?twitter\\.com\\/", + "^https?:\\/{2}(pbs\\.|video\\.)twimg\\.com\\/", + "^https?:\\/{2}platform\\.twitter\\.com/embed\\/", + "^https?:\\/{2}t\\.co\\/" ], "name": "Twitter", "options": { @@ -169,7 +164,7 @@ } }, "targets": [ - "^https?:\\/{2}(www\\.)?tiktok\\.com(\\/|$)" + "^https?:\\/{2}(www\\.)?tiktok\\.com\\/" ], "name": "TikTok", "options": { @@ -221,7 +216,7 @@ } }, "targets": [ - "^https?:\\/{2}([im]\\.)?(stack\\.)?imgur\\.(com|io)(\\/|$)" + "^https?:\\/{2}([im]\\.)?(stack\\.)?imgur\\.(com|io)\\/" ], "name": "Imgur", "options": { @@ -269,25 +264,25 @@ } }, "targets": [ - "^https:\\/{2}([a-zA-Z0-9_-]+\\.)?medium\\.com", - "^https?:\\/{2}towardsdatascience\\.com(\\/|$)", - "^https?:\\/{2}uxdesign\\.cc(\\/|$)", - "^https?:\\/{2}uxplanet\\.org(\\/|$)", - "^https?:\\/{2}betterprogramming\\.pub(\\/|$)", - "^https?:\\/{2}aninjusticemag\\.com(\\/|$)", - "^https?:\\/{2}betterhumans\\.pub(\\/|$)", - "^https?:\\/{2}psiloveyou\\.xyz(\\/|$)", - "^https?:\\/{2}entrepreneurshandbook\\.co(\\/|$)", - "^https?:\\/{2}blog\\.coinbase\\.com(\\/|$)", - "^https?:\\/{2}levelup\\.gitconnected\\.com(\\/|$)", - "^https?:\\/{2}javascript\\.plainenglish\\.io(\\/|$)", - "^https?:\\/{2}blog\\.bitsrc\\.io(\\/|$)", - "^https?:\\/{2}itnext\\.io(\\/|$)", - "^https?:\\/{2}codeburst\\.io(\\/|$)", - "^https?:\\/{2}infosecwriteups\\.com(\\/|$)", - "^https?:\\/{2}blog\\.devgenius\\.io(\\/|$)", - "^https?:\\/{2}writingcooperative\\.com(\\/|$)", - "^https?:\\/{2}proandroiddev\\.com(\\/|$)" + "^https:\\/{2}([a-zA-Z0-9-]+\\.)?medium\\.com", + "^https?:\\/{2}towardsdatascience\\.com\\/", + "^https?:\\/{2}uxdesign\\.cc\\/", + "^https?:\\/{2}uxplanet\\.org\\/", + "^https?:\\/{2}betterprogramming\\.pub\\/", + "^https?:\\/{2}aninjusticemag\\.com\\/", + "^https?:\\/{2}betterhumans\\.pub\\/", + "^https?:\\/{2}psiloveyou\\.xyz\\/", + "^https?:\\/{2}entrepreneurshandbook\\.co\\/", + "^https?:\\/{2}blog\\.coinbase\\.com\\/", + "^https?:\\/{2}levelup\\.gitconnected\\.com\\/", + "^https?:\\/{2}javascript\\.plainenglish\\.io\\/", + "^https?:\\/{2}blog\\.bitsrc\\.io\\/", + "^https?:\\/{2}itnext\\.io\\/", + "^https?:\\/{2}codeburst\\.io\\/", + "^https?:\\/{2}infosecwriteups\\.com\\/", + "^https?:\\/{2}blog\\.devgenius\\.io\\/", + "^https?:\\/{2}writingcooperative\\.com\\/", + "^https?:\\/{2}proandroiddev\\.com\\/" ], "name": "Medium", "options": { @@ -308,7 +303,7 @@ } }, "targets": [ - "^https?:\\/{2}([a-zA-Z0-9-]+\\.)*quora\\.com(\\/|$)" + "^https?:\\/{2}([a-zA-Z0-9-]+\\.)*quora\\.com\\/" ], "name": "Quora", "options": { diff --git a/src/manifest.json b/src/manifest.json index 2540f1f..d8e1e60 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_extensionName__", "description": "__MSG_extensionDescription__", - "version": "2.7.0", + "version": "2.7.1", "manifest_version": 2, "browser_specific_settings": { "gecko": {