1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-06 09:37:12 +02:00

Accept ubo:// (#3682)

This prevents AdBlock and ABP from reacting to subscription links of uBO-only filters.
This commit is contained in:
Hugo Xu 2018-04-06 15:32:18 -06:00 committed by Raymond Hill
parent f53d34d397
commit 47ae08b0b1

View File

@ -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);
}