Fixed wiki redirect bug #173. i2p to wikiless list. Fixed imgur redirect #175 #166

This commit is contained in:
ManeraKai 2022-04-08 03:18:05 +03:00
parent 69ac9e6334
commit 31c642fc90
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337
3 changed files with 13 additions and 2 deletions

View File

@ -107,7 +107,15 @@ function redirect(url, type) {
// https://imgur.com/gallery/cTRwaJU
// https://i.imgur.com/CFSQArP.jpeg
if (type != "main_frame" && type != "sub_frame" && type != "xmlhttprequest" && type != "other") return null;
if (![
"main_frame",
"sub_frame",
"xmlhttprequest",
"other",
"image",
"media",
].includes(type)) return null;
if (url.pathname.includes("delete/")) return null;
let instancesList;

View File

@ -2,7 +2,7 @@ window.browser = window.browser || window.chrome;
import commonHelper from './common.js'
const targets = /^https?:\/{2}(.*\.|)wikipedia\.org/
const targets = /^https?:\/{2}([a-z]{1,}\.|)wikipedia\.org/
let redirects = {
"wikiless": {

View File

@ -108,9 +108,12 @@ rJson = json.loads(r.text)
wikilessList = {}
wikilessList['normal'] = []
wikilessList['tor'] = []
wikilessList['i2p'] = []
for item in rJson:
if item.endswith('.onion'):
wikilessList['tor'].append('http://' + item)
elif item.endswith('.i2p'):
wikilessList['i2p'].append('http://' + item)
else:
wikilessList['normal'].append('https://' + item)
mightyList['wikiless'] = wikilessList