mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-27 20:03:45 +03:00
No inform for resources from proxy hostname/ip, fixes #32
This commit is contained in:
parent
1f31f2bce7
commit
3b03be61c5
|
@ -142,6 +142,23 @@
|
||||||
if (!host) {
|
if (!host) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
If we fetch a resource from a proxy address it is almost never proxied and
|
||||||
|
shouldn't be shown.
|
||||||
|
Think about localhost as a proxy and a user working with a web site on localhost.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
Host is constructed from hostname and port. Hostname never contains port,
|
||||||
|
it is an ip or a domain name. See hostname and host
|
||||||
|
in `new URL('https://localhost:8080')`.
|
||||||
|
*/
|
||||||
|
const hostnameFromUrl = new URL(requestDetails.url).hostname;
|
||||||
|
const hostnameFromProxy = new URL(`https://${host}`).hostname;
|
||||||
|
if (hostnameFromUrl === requestDetails.ip || hostnameFromUrl === hostnameFromProxy) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const ifMainFrame = requestDetails.type === 'main_frame';
|
const ifMainFrame = requestDetails.type === 'main_frame';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user