From 99f605d28aeea7c0de4b377ca12731d9abf68a18 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 21 Sep 2020 07:25:24 -0400 Subject: [PATCH] Minor code review of subscriber scriptlet --- src/js/scriptlets/subscriber.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/js/scriptlets/subscriber.js b/src/js/scriptlets/subscriber.js index aeb96ce89..b3a9226be 100644 --- a/src/js/scriptlets/subscriber.js +++ b/src/js/scriptlets/subscriber.js @@ -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();