From ec5191004cb455ff4bc1d13abd69b12483a19c4d Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 4 Nov 2019 13:12:40 -0500 Subject: [PATCH] Use encodeURIComponent instead of btoa Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/772 --- src/js/document-blocked.js | 2 +- src/js/tab.js | 2 +- src/js/traffic.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/document-blocked.js b/src/js/document-blocked.js index 858f2d80d..746e03557 100644 --- a/src/js/document-blocked.js +++ b/src/js/document-blocked.js @@ -35,7 +35,7 @@ let details = {}; { const matches = /details=([^&]+)/.exec(window.location.search); if ( matches !== null ) { - details = JSON.parse(atob(matches[1])); + details = JSON.parse(decodeURIComponent(matches[1])); } } diff --git a/src/js/tab.js b/src/js/tab.js index 1e30bdfbd..eeb19f554 100644 --- a/src/js/tab.js +++ b/src/js/tab.js @@ -311,7 +311,7 @@ if ( targetURL.startsWith(vAPI.getURL('document-blocked.html')) ) { const matches = /details=([^&]+)/.exec(targetURL); if ( matches !== null ) { - targetURL = JSON.parse(atob(matches[1])).url; + targetURL = JSON.parse(decodeURIComponent(matches[1])).url; } } diff --git a/src/js/traffic.js b/src/js/traffic.js index 56da0a93d..9ce242120 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -217,7 +217,7 @@ const onBeforeRootFrameRequest = function(fctxt) { if ( logData === undefined ) { return; } // Blocked - const query = btoa(JSON.stringify({ + const query = encodeURIComponent(JSON.stringify({ url: requestURL, hn: requestHostname, dn: fctxt.getDomain() || requestHostname,