Skip to content

Commit

Permalink
this addresses #414
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Jun 30, 2015
1 parent e5d6acd commit ecd003f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion platform/chromium/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"matches": [
"https://*.adblockplus.org/*",
"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"],
"run_at": "document_idle"
Expand Down
5 changes: 4 additions & 1 deletion platform/firefox/frameModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,10 @@ const contentObserver = {
doc.removeEventListener(e.type, docReady, true);
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);
}
};
Expand Down
12 changes: 9 additions & 3 deletions src/js/subscriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if ( document instanceof HTMLDocument === false ) {
}

// Because in case
if ( !vAPI ) {
if ( typeof vAPI !== 'object' ) {
//console.debug('subscriber.js > vAPI not found');
return;
}
Expand All @@ -52,7 +52,10 @@ if ( !vAPI ) {
// The links look like this:
// 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;
}

Expand Down Expand Up @@ -81,7 +84,10 @@ var onAbpLinkClicked = function(ev) {
}
var matches = /^abp:\/*subscribe\/*\?location=([^&]+).*title=([^&]+)/.exec(href);
if ( matches === null ) {
return;
matches = /^https?:\/\/[^?]+\?location=([^&]+).*title=([^&]+)/.exec(href);

This comment has been minimized.

Copy link
@gwarser

gwarser Jun 30, 2015

Contributor

Should not https://subscribe.adblockplus.org/ always be first part of the subscribe URL to allow including special subscribing script for this domain only? Or even intercepting filter list url inside filtering engine? (I know ABP scans DOM for all links)

This comment has been minimized.

Copy link
@gorhill

gorhill Jun 30, 2015

Author Owner

I know ABP plans to support https://subscribe.adblockplus.org/...?location=... for subscription syntax, but I haven't stumbled upon a case yet. I will take it into account when the new syntax is actually in use.

if ( matches === null ) {
return;
}
}
var location = decodeURIComponent(matches[1]);
var title = decodeURIComponent(matches[2]);
Expand Down

0 comments on commit ecd003f

Please sign in to comment.