diff --git a/src/js/messaging.js b/src/js/messaging.js index 0cc176849..74e761963 100644 --- a/src/js/messaging.js +++ b/src/js/messaging.js @@ -1858,13 +1858,13 @@ const onMessage = function(request, sender, callback) { break; case 'subscribeTo': + // https://github.com/uBlockOrigin/uBlock-issues/issues/1797 + if ( /^(file|https?):\/\//.test(request.location) === false ) { break; } const url = encodeURIComponent(request.location); const title = encodeURIComponent(request.title); const hash = µb.selectedFilterLists.indexOf(request.location) !== -1 ? '#subscribed' : ''; - // https://github.com/uBlockOrigin/uBlock-issues/issues/1797 - if ( /^(file|https?):\/\//.test(url) === false ) { break; } vAPI.tabs.open({ url: `/asset-viewer.html?url=${url}&title=${title}&subscribe=1${hash}`, select: true,