mirror of
https://github.com/gorhill/uBlock.git
synced 2025-01-31 20:21:35 +01:00
Minor code review of subscriber scriptlet
This commit is contained in:
parent
1cdffea618
commit
99f605d28a
@ -55,11 +55,12 @@ const onMaybeSubscriptionLinkClicked = function(ev) {
|
||||
return;
|
||||
}
|
||||
|
||||
const subscribeURL = new URL('about:blank');
|
||||
try {
|
||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/763#issuecomment-691696716
|
||||
// Remove replacement patch if/when filterlists.com fixes encoded '&'.
|
||||
subscribeURL.href = target.href.replace('&title=', '&title=');
|
||||
const subscribeURL = new URL(
|
||||
target.href.replace('&title=', '&title=')
|
||||
);
|
||||
if (
|
||||
/^(abp|ubo):$/.test(subscribeURL.protocol) === false &&
|
||||
subscribeURL.hostname !== 'subscribe.adblockplus.org'
|
||||
@ -71,8 +72,8 @@ const onMaybeSubscriptionLinkClicked = function(ev) {
|
||||
if ( location === '' || title === '' ) { return; }
|
||||
vAPI.messaging.send('scriptlets', {
|
||||
what: 'subscribeTo',
|
||||
location: decodeURIComponent(location),
|
||||
title: decodeURIComponent(title),
|
||||
location,
|
||||
title,
|
||||
});
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
|
Loading…
x
Reference in New Issue
Block a user