diff options
author | ManeraKai <manerakai@protonmail.com> | 2023-07-22 13:14:35 +0300 |
---|---|---|
committer | ManeraKai <manerakai@protonmail.com> | 2023-07-23 21:43:06 +0300 |
commit | 623aacfad2606d9d4df8357951a6299ffccc4930 (patch) | |
tree | b6383e1d7f2cc5c8663a5e805d277cb2d2073def /src/assets/javascripts | |
parent | Fixed bug in medium https://github.com/libredirect/browser_extension/issues/764 (diff) | |
download | libredirect-623aacfad2606d9d4df8357951a6299ffccc4930.zip |
Hopefully fixing https://github.com/libredirect/browser_extension/issues/765
Diffstat (limited to 'src/assets/javascripts')
-rw-r--r-- | src/assets/javascripts/services.js | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index d0d85acd..0005770d 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'], |