aboutsummaryrefslogtreecommitdiffstats
path: root/src/assets/javascripts
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2023-06-15 20:43:52 +0300
committerManeraKai <manerakai@protonmail.com>2023-06-15 20:43:52 +0300
commit74560b14d82e54bbcf47603d66a795312c293622 (patch)
tree1721f916445faa43756a37b7192b1e2738b881ff /src/assets/javascripts
parentAdded language support for Quetre https://github.com/libredirect/browser_exte... (diff)
downloadlibredirect-74560b14d82e54bbcf47603d66a795312c293622.zip
Added PixivFE https://github.com/libredirect/browser_extension/issues/735
Diffstat (limited to 'src/assets/javascripts')
-rw-r--r--src/assets/javascripts/services.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index 22b73f57..412c044a 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -554,9 +554,6 @@ function redirect(url, type, initiator, forceRedirection) {
if (path == "/") path = ""
return `${randomInstance}/${url.hostname}${path}${url.search}`
}
- default: {
- return `${randomInstance}${url.pathname}${url.search}`
- }
case "quetre": {
const regex = /([a-z]+)\.quora\.com/.exec(url.hostname)
console.log(regex)
@@ -567,6 +564,17 @@ function redirect(url, type, initiator, forceRedirection) {
}
return `${randomInstance}${url.pathname}${url.search}`
}
+ case "pixivFe": {
+ const regex = /\/[a-z]{1,3}\/(.*)/.exec(url.pathname)
+ if (regex) {
+ const path = regex[1]
+ return `${randomInstance}/${path}${url.search}`
+ }
+ return `${randomInstance}${url.pathname}${url.search}`
+ }
+ default: {
+ return `${randomInstance}${url.pathname}${url.search}`
+ }
}
}
@@ -711,7 +719,8 @@ const defaultInstances = {
"laboratory": ['https://lab.vern.cc'],
"libreSpeed": ['https://librespeed.org'],
'jitsi': ['https://meet.jit.si', 'https://8x8.vc'],
- 'binternet': ['https://binternet.ahwx.org']
+ 'binternet': ['https://binternet.ahwx.org'],
+ 'pixivFe': ['https://pixivfe.exozy.me']
}
function initDefaults() {