this addresses #414

This commit is contained in:
gorhill 2015-06-30 01:59:22 -04:00
parent e5d6acd712
commit ecd003ff4a
3 changed files with 15 additions and 5 deletions

View file

@ -41,7 +41,8 @@
"matches": [ "matches": [
"https://*.adblockplus.org/*", "https://*.adblockplus.org/*",
"https://*.adblockplus.me/*", "https://*.adblockplus.me/*",
"https://www.fanboy.co.nz/*" "https://www.fanboy.co.nz/*",
"https://github.com/gorhill/uBlock/wiki/Filter-lists-from-around-the-web"
], ],
"js": ["js/subscriber.js"], "js": ["js/subscriber.js"],
"run_at": "document_idle" "run_at": "document_idle"

View file

@ -355,7 +355,10 @@ const contentObserver = {
doc.removeEventListener(e.type, docReady, true); doc.removeEventListener(e.type, docReady, true);
lss(this.contentBaseURI + 'contentscript-end.js', sandbox); lss(this.contentBaseURI + 'contentscript-end.js', sandbox);
if ( doc.querySelector('a[href^="abp:"]') ) { if (
doc.querySelector('a[href^="abp:"]') ||
loc.href === 'https://github.com/gorhill/uBlock/wiki/Filter-lists-from-around-the-web'
) {
lss(this.contentBaseURI + 'subscriber.js', sandbox); lss(this.contentBaseURI + 'subscriber.js', sandbox);
} }
}; };

View file

@ -41,7 +41,7 @@ if ( document instanceof HTMLDocument === false ) {
} }
// Because in case // Because in case
if ( !vAPI ) { if ( typeof vAPI !== 'object' ) {
//console.debug('subscriber.js > vAPI not found'); //console.debug('subscriber.js > vAPI not found');
return; return;
} }
@ -52,7 +52,10 @@ if ( !vAPI ) {
// The links look like this: // The links look like this:
// abp:subscribe?location=https://easylist-downloads.adblockplus.org/easyprivacy.txt[...] // abp:subscribe?location=https://easylist-downloads.adblockplus.org/easyprivacy.txt[...]
if ( document.querySelector('a[href^="abp:"]') === null ) { if (
document.querySelector('a[href^="abp:"]') === null &&
window.location.href !== 'https://github.com/gorhill/uBlock/wiki/Filter-lists-from-around-the-web'
) {
return; return;
} }
@ -81,7 +84,10 @@ var onAbpLinkClicked = function(ev) {
} }
var matches = /^abp:\/*subscribe\/*\?location=([^&]+).*title=([^&]+)/.exec(href); var matches = /^abp:\/*subscribe\/*\?location=([^&]+).*title=([^&]+)/.exec(href);
if ( matches === null ) { if ( matches === null ) {
return; matches = /^https?:\/\/[^?]+\?location=([^&]+).*title=([^&]+)/.exec(href);
if ( matches === null ) {
return;
}
} }
var location = decodeURIComponent(matches[1]); var location = decodeURIComponent(matches[1]);
var title = decodeURIComponent(matches[2]); var title = decodeURIComponent(matches[2]);