improve js rewriting functionality by not relying on js to get proxy and proxified URLs; direct injection from golang
This commit is contained in:
@@ -27,12 +27,14 @@
|
||||
if (blacklistedSchemes.includes(url)) return url;
|
||||
|
||||
// don't double rewrite
|
||||
const proxyOrigin = globalThis.window.location.origin;
|
||||
//const proxyOrigin = globalThis.window.location.origin;
|
||||
const proxyOrigin = `${PROXY_ORIGIN_INJECT_FROM_GOLANG}`;
|
||||
if (url.startsWith(proxyOrigin)) return url;
|
||||
if (url.startsWith(`/${proxyOrigin}`)) return url;
|
||||
if (url.startsWith(`/${origin}`)) return url;
|
||||
|
||||
const origin = (new URL(decodeURIComponent(globalThis.window.location.pathname.substring(1)))).origin
|
||||
//const origin = (new URL(decodeURIComponent(globalThis.window.location.pathname.substring(1)))).origin
|
||||
const origin = `${ORIGIN_INJECT_FROM_GOLANG}`;
|
||||
//console.log(`proxychain: origin: ${origin} // proxyOrigin: ${proxyOrigin} // original: ${oldUrl}`)
|
||||
|
||||
if (url.startsWith("//")) {
|
||||
|
||||
Reference in New Issue
Block a user