mirror of
https://codeberg.org/LibRedirect/libredirect.git
synced 2025-02-08 08:08:50 +01:00
Fixed sub_frame or instagram #166
This commit is contained in:
parent
c767a39b2c
commit
8fb929399e
@ -105,7 +105,16 @@ function redirect(url, type, initiator) {
|
|||||||
|
|
||||||
if (!targets.includes(url.host)) return;
|
if (!targets.includes(url.host)) return;
|
||||||
|
|
||||||
if (type !== "main_frame" || bypassPaths.some(rx => rx.test(url.pathname))) return;
|
if (![
|
||||||
|
"main_frame",
|
||||||
|
"sub_frame",
|
||||||
|
"xmlhttprequest",
|
||||||
|
"other",
|
||||||
|
"image",
|
||||||
|
"media",
|
||||||
|
].includes(type)) return null;
|
||||||
|
|
||||||
|
if (bypassPaths.some(rx => rx.test(url.pathname))) return;
|
||||||
|
|
||||||
let instancesList;
|
let instancesList;
|
||||||
if (protocol == 'normal') instancesList = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects];
|
if (protocol == 'normal') instancesList = [...bibliogramNormalRedirectsChecks, ...bibliogramNormalCustomRedirects];
|
||||||
|
@ -108,7 +108,7 @@ function redirect(url, type) {
|
|||||||
if (instancesList.length === 0) return null;
|
if (instancesList.length === 0) return null;
|
||||||
let randomInstance = commonHelper.getRandomInstance(instancesList);
|
let randomInstance = commonHelper.getRandomInstance(instancesList);
|
||||||
|
|
||||||
let pathName = url.pathname.replace(/@.*\/(?=video)/, "");
|
// let pathName = url.pathname.replace(/@.*\/(?=video)/, "");
|
||||||
|
|
||||||
return `${randomInstance}${url.pathname}`;
|
return `${randomInstance}${url.pathname}`;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user