From 5c943a98f684df01038fc280f453a0900635e819 Mon Sep 17 00:00:00 2001 From: erosman Date: Tue, 19 Sep 2023 21:28:36 +0330 Subject: [PATCH] Add files via upload --- src/content/help.html | 5 +++-- src/content/on-request.js | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/content/help.html b/src/content/help.html index 485ad7b..eb06b95 100644 --- a/src/content/help.html +++ b/src/content/help.html @@ -160,13 +160,14 @@

Save

Proxy

-

Connections to localhost, 127.0.0.1/8, and ::1 are never proxied.

+

Connections to localhost, 127.0.0.1/8, and ::1 are never proxied.

-

In Chrome FoxyProxy uses PAC and above rule is fully enforced. In Firefox API, it requires further testing.

+ + diff --git a/src/content/on-request.js b/src/content/on-request.js index 5d1dfdb..91bda94 100644 --- a/src/content/on-request.js +++ b/src/content/on-request.js @@ -12,11 +12,11 @@ export class OnRequest { static { // --- default values - this.mode = 'disable'; // default start - this.proxy = null; // needed only in Single Proxy - this.data = []; // needed only in Proxy by Pattern + this.mode = 'disable'; + this.proxy = null; // only needed in Single Proxy + this.data = []; // only needed in Proxy by Pattern this.globalExclude = []; - this.proxyDNS = true; // default true + this.proxyDNS = true; // --- Firefox Only browser?.proxy?.onRequest?.addListener(e => this.#process(e), {urls: ['']}); @@ -77,6 +77,7 @@ export class OnRequest { // proxy.onRequest does not have a default localhost bypass // proxy.onRequest only apply to http/https/ws/wss // Implementing a default localhost bypass + // it can't catch a domain set by user to 127.0.0.1 in the hosts file static #bypass(url) { const [, host] = url.split(/:\/\/|\//); // hostname with/without port const isIP = /^[\d.:]+$/.test(host);