Raymond Hill 5 years ago
parent f8c82add03
commit 3f4425d9db
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

@ -55,7 +55,7 @@ const µm = µMatrix;
// its APIs, but since this is not the case, uMatrix inherits the duty to // its APIs, but since this is not the case, uMatrix inherits the duty to
// make it seamless on its side. // make it seamless on its side.
if ( pageURL.startsWith('wyciwyg:') ) { if ( pageURL.startsWith('wyciwyg:') ) {
let match = /^wyciwyg:\/\/\d+\//.exec(pageURL); const match = /^wyciwyg:\/\/\d+\//.exec(pageURL);
if ( match !== null ) { if ( match !== null ) {
pageURL = pageURL.slice(match[0].length); pageURL = pageURL.slice(match[0].length);
} }
@ -64,18 +64,18 @@ const µm = µMatrix;
// If the URL is that of our "blocked page" document, return the URL of // If the URL is that of our "blocked page" document, return the URL of
// the blocked page. // the blocked page.
if ( pageURL.startsWith(vAPI.getURL('main-blocked.html')) ) { if ( pageURL.startsWith(vAPI.getURL('main-blocked.html')) ) {
let matches = /main-blocked\.html\?details=([^&]+)/.exec(pageURL); const parsedURL = new URL(pageURL);
if ( matches && matches.length === 2 ) { const details = parsedURL.searchParams.get('details');
if ( details ) {
try { try {
let details = JSON.parse(atob(matches[1])); pageURL = JSON.parse(decodeURIComponent(details)).url;
pageURL = details.url; } catch (ex) {
} catch (e) {
} }
} }
} }
let uri = this.URI.set(pageURL); const uri = this.URI.set(pageURL);
let scheme = uri.scheme; const scheme = uri.scheme;
if ( scheme === 'https' || scheme === 'http' ) { if ( scheme === 'https' || scheme === 'http' ) {
return uri.normalizedURI(); return uri.normalizedURI();
} }

Loading…
Cancel
Save