Skip to content

Commit

Permalink
Use encodeURIComponent instead of btoa
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Nov 4, 2019
1 parent 53304db commit ec51910
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/js/document-blocked.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/traffic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ec51910

Please sign in to comment.