Fix wrong URL

This commit is contained in:
foxster-mp4
2023-04-30 11:15:07 -07:00
parent a94b34225d
commit 2456da796d
4 changed files with 6 additions and 155 deletions

View File

@@ -1,5 +1,10 @@
(function main() {
const success = url => window.location.replace(`${window.location.host}?source=${url}`);
const success = url => {
const host = window.location.host;
var path = window.location.pathname.split("/")[1];
path = path?.trim === "" ? "" : `/${path}`;
window.location.replace(`${host}${path}?source=${url}`
)};
// If valid source provided
if (urlSearchParams.has('source') && isValidHTTPURL(sourceURL))