From 633d56eaa42003496f7bae64c49dec84864a9fe8 Mon Sep 17 00:00:00 2001 From: koops76 Date: Tue, 7 Nov 2017 19:05:03 +0300 Subject: [PATCH 1/4] Update background.js --- chromium/background.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/chromium/background.js b/chromium/background.js index 6065faba479a..26d54f6702ad 100644 --- a/chromium/background.js +++ b/chromium/background.js @@ -226,14 +226,14 @@ function onBeforeRequest(details) { const uri = new URL(details.url); // Should the request be canceled? - var shouldCancel = ( - httpNowhereOn && - uri.protocol === 'http:' && - !/\.onion$/.test(uri.hostname) && - !/^localhost$/.test(uri.hostname) && - !/^127(\.[0-9]{1,3}){3}$/.test(uri.hostname) && - !/^0\.0\.0\.0$/.test(uri.hostname) - ); + var shouldCancel = httpNowhereOn && + !uri.protocol === 'https:' && + !uri.hostname.slice(-6) === '.onion' && + !uri.hostname === 'localhost' && + !uri.hostname === '[::1]' && + !/^127(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})){3}$/.test(uri.hostname) && + !uri.hostname === '[::]' && + !uri.hostname === '0.0.0.0'; // Normalise hosts such as "www.example.com." var canonical_host = uri.hostname; From 45b57be2936f5cd089fc9cde890663efdece3d33 Mon Sep 17 00:00:00 2001 From: koops76 Date: Tue, 7 Nov 2017 19:10:12 +0300 Subject: [PATCH 2/4] Update background.js --- chromium/background.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chromium/background.js b/chromium/background.js index 26d54f6702ad..68f37f00536a 100644 --- a/chromium/background.js +++ b/chromium/background.js @@ -230,10 +230,10 @@ function onBeforeRequest(details) { !uri.protocol === 'https:' && !uri.hostname.slice(-6) === '.onion' && !uri.hostname === 'localhost' && - !uri.hostname === '[::1]' && !/^127(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})){3}$/.test(uri.hostname) && - !uri.hostname === '[::]' && - !uri.hostname === '0.0.0.0'; + !uri.hostname === '0.0.0.0' && + !uri.hostname === '[::1]' && + !uri.hostname === '[::]'; // Normalise hosts such as "www.example.com." var canonical_host = uri.hostname; From 5f5d09b3ddb393f426c34d5bdcb3e39eda47e6c8 Mon Sep 17 00:00:00 2001 From: koops76 Date: Tue, 7 Nov 2017 19:12:08 +0300 Subject: [PATCH 3/4] Update background.js --- chromium/background.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/chromium/background.js b/chromium/background.js index 68f37f00536a..f9dac9cf0458 100644 --- a/chromium/background.js +++ b/chromium/background.js @@ -231,9 +231,7 @@ function onBeforeRequest(details) { !uri.hostname.slice(-6) === '.onion' && !uri.hostname === 'localhost' && !/^127(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})){3}$/.test(uri.hostname) && - !uri.hostname === '0.0.0.0' && - !uri.hostname === '[::1]' && - !uri.hostname === '[::]'; + !uri.hostname === '[::1]'; // Normalise hosts such as "www.example.com." var canonical_host = uri.hostname; From df02cafa178c44d284139b1395a88f0b25d28de0 Mon Sep 17 00:00:00 2001 From: koops76 Date: Tue, 7 Nov 2017 20:15:46 +0300 Subject: [PATCH 4/4] Update background.js --- chromium/background.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chromium/background.js b/chromium/background.js index f9dac9cf0458..7422343dde12 100644 --- a/chromium/background.js +++ b/chromium/background.js @@ -227,11 +227,11 @@ function onBeforeRequest(details) { // Should the request be canceled? var shouldCancel = httpNowhereOn && - !uri.protocol === 'https:' && - !uri.hostname.slice(-6) === '.onion' && - !uri.hostname === 'localhost' && + uri.protocol !== 'https:' && + uri.hostname.slice(-6) !== '.onion' && + uri.hostname !== 'localhost' && !/^127(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})){3}$/.test(uri.hostname) && - !uri.hostname === '[::1]'; + uri.hostname !== '[::1]'; // Normalise hosts such as "www.example.com." var canonical_host = uri.hostname;