1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-05 18:32:30 +01:00

Fix bad test breaking list subscription

Related issue/feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1797#issuecomment-965150304
This commit is contained in:
Raymond Hill 2021-11-10 08:49:28 -05:00
parent 3b53c3a3e3
commit c2c2cef4e6
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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,