From ebfc616b62694b5a982b728b93b6ad80cf6aadee Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Sat, 2 Mar 2019 16:43:47 +0100 Subject: Fix wyciwyg URLs Ported from uMatrix. --- js/tab.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'js/tab.js') diff --git a/js/tab.js b/js/tab.js index 09bbef8..2d6af4a 100644 --- a/js/tab.js +++ b/js/tab.js @@ -50,6 +50,15 @@ var ηm = ηMatrix; return 'http://' + this.behindTheSceneScope + '/'; } + // https://github.com/gorhill/uMatrix/issues/992 + if (pageURL.startsWith('wyciwyg:')) { + // Matches strings like 'wyciwyg://101/' + let filter = /^wyciwyg:\/\/\d+\//.exec(pageURL); + if (filter) { + pageURL = pageURL.slice(filter[0].length); + } + } + // If the URL is that of our "blocked page" document, return the URL of // the blocked page. if ( pageURL.lastIndexOf(vAPI.getURL('main-blocked.html'), 0) === 0 ) { -- cgit v1.2.3