From 47ae08b0b17d4511ece11a5321a7eb4f10421479 Mon Sep 17 00:00:00 2001 From: Hugo Xu Date: Fri, 6 Apr 2018 15:32:18 -0600 Subject: [PATCH] Accept `ubo://` (#3682) This prevents AdBlock and ABP from reacting to subscription links of uBO-only filters. --- src/js/scriptlets/subscriber.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/scriptlets/subscriber.js b/src/js/scriptlets/subscriber.js index 944944e0f..3ae0a951a 100644 --- a/src/js/scriptlets/subscriber.js +++ b/src/js/scriptlets/subscriber.js @@ -66,7 +66,7 @@ var onMaybeAbpLinkClicked = function(ev) { if ( href === '' ) { return; } - var matches = /^abp:\/*subscribe\/*\?location=([^&]+).*title=([^&]+)/.exec(href); + var matches = /^(?:abp|ubo):\/*subscribe\/*\?location=([^&]+).*title=([^&]+)/.exec(href); if ( matches === null ) { matches = /^https?:\/\/.*?[&?]location=([^&]+).*?&title=([^&]+)/.exec(href); if ( matches === null ) { return; } @@ -112,7 +112,7 @@ var onMaybeAbpLinkClicked = function(ev) { setTimeout(function() { if ( document.querySelector('link[rel="canonical"][href="https://filterlists.com/"]') !== null || - document.querySelector('a[href^="abp:"],a[href^="https://subscribe.adblockplus.org/?"]') !== null + document.querySelector('a[href^="abp:"],a[href^="ubo:"],a[href^="https://subscribe.adblockplus.org/?"]') !== null ) { document.addEventListener('click', onMaybeAbpLinkClicked); }