mirror of
https://codeberg.org/teddit/teddit.git
synced 2026-04-18 21:45:06 -04:00
fix error while trying to localize an URL
This commit is contained in:
@@ -70,10 +70,12 @@ meta(name="viewport", content="width=device-width, initial-scale=1.0")
|
||||
}
|
||||
|
||||
function localize(url) {
|
||||
let u = new URL(url)
|
||||
if(u.host === 'www.reddit.com' || u.host === 'reddit.com') {
|
||||
url = url.replace(u.host, 'teddit.net')
|
||||
}
|
||||
try {
|
||||
let u = new URL(url)
|
||||
if(u.host === 'www.reddit.com' || u.host === 'reddit.com') {
|
||||
url = url.replace(u.host, 'teddit.net')
|
||||
}
|
||||
} catch(e) { }
|
||||
return url
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user