Skip to content

Commit

Permalink
Fixed AnonymousOverflow answers linking problem #619. Fixed Freetube #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed Feb 6, 2023
1 parent 617b0da commit 5f45e0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions src/assets/javascripts/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ function redirect(url, type, initiator, forceRedirection) {
continue
}

let instanceList = options[frontend]
if (instanceList === undefined) break
if (instanceList.length === 0) return

if (
initiator
&&
options[frontend].includes(initiator.origin)
instanceList.includes(initiator.origin)
) return "BYPASSTAB"

let instanceList = options[frontend]
if (instanceList === undefined) break
if (instanceList.length === 0) return

randomInstance = utils.getRandomInstance(instanceList)

break
Expand Down Expand Up @@ -414,13 +414,15 @@ function redirect(url, type, initiator, forceRedirection) {
if (url.pathname.endsWith('-lyrics')) return `${randomInstance}${url.pathname}`
}
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}`
}
case "anonymousOverflow": {
if (!url.pathname.startsWith('/questions') && url.pathname != '/') return
const threadID = /\/\d+(?=[?&#/]|$)/.exec(url.pathname)?.[0]
return `${randomInstance}${threadID ? '/questions' + threadID : url.pathname}${url.search}`
const threadID = /\/(\d+)\/?$/.exec(url.pathname)
if (threadID) return `${randomInstance}/questions/${threadID[1]}${url.search}`
return `${randomInstance}${url.pathname}${url.search}`

}
case "biblioReads": {
if (!url.pathname.startsWith('/book/show/') && url.pathname != '/') return
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "2.5.1",
"version": "2.5.2",
"manifest_version": 2,
"browser_specific_settings": {
"gecko": {
Expand Down

0 comments on commit 5f45e0b

Please sign in to comment.