This commit is contained in:
ManeraKai 2023-02-06 18:05:15 +03:00
parent 617b0da884
commit 5f45e0b09c
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337
2 changed files with 12 additions and 10 deletions

View File

@ -59,16 +59,16 @@ function redirect(url, type, initiator, forceRedirection) {
continue continue
} }
if (
initiator
&&
options[frontend].includes(initiator.origin)
) return "BYPASSTAB"
let instanceList = options[frontend] let instanceList = options[frontend]
if (instanceList === undefined) break if (instanceList === undefined) break
if (instanceList.length === 0) return if (instanceList.length === 0) return
if (
initiator
&&
instanceList.includes(initiator.origin)
) return "BYPASSTAB"
randomInstance = utils.getRandomInstance(instanceList) randomInstance = utils.getRandomInstance(instanceList)
break break
@ -414,13 +414,15 @@ function redirect(url, type, initiator, forceRedirection) {
if (url.pathname.endsWith('-lyrics')) return `${randomInstance}${url.pathname}` if (url.pathname.endsWith('-lyrics')) return `${randomInstance}${url.pathname}`
} }
case "ruralDictionary": { case "ruralDictionary": {
if (!url.pathname.endsWith('/define.php') && !url.pathname.endsWith('/random.php') && url.pathname != '/') return if (!url.pathname.includes('/define.php') && !url.pathname.includes('/random.php') && url.pathname != '/') return
return `${randomInstance}${url.pathname}${url.search}` return `${randomInstance}${url.pathname}${url.search}`
} }
case "anonymousOverflow": { case "anonymousOverflow": {
if (!url.pathname.startsWith('/questions') && url.pathname != '/') return if (!url.pathname.startsWith('/questions') && url.pathname != '/') return
const threadID = /\/\d+(?=[?&#/]|$)/.exec(url.pathname)?.[0] const threadID = /\/(\d+)\/?$/.exec(url.pathname)
return `${randomInstance}${threadID ? '/questions' + threadID : url.pathname}${url.search}` if (threadID) return `${randomInstance}/questions/${threadID[1]}${url.search}`
return `${randomInstance}${url.pathname}${url.search}`
} }
case "biblioReads": { case "biblioReads": {
if (!url.pathname.startsWith('/book/show/') && url.pathname != '/') return if (!url.pathname.startsWith('/book/show/') && url.pathname != '/') return

View File

@ -1,7 +1,7 @@
{ {
"name": "__MSG_extensionName__", "name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__", "description": "__MSG_extensionDescription__",
"version": "2.5.1", "version": "2.5.2",
"manifest_version": 2, "manifest_version": 2,
"browser_specific_settings": { "browser_specific_settings": {
"gecko": { "gecko": {