-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
} | ||
|
@@ -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; | ||
} | ||
|
||
|
@@ -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.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
gorhill
Author
Owner
|
||
if ( matches === null ) { | ||
return; | ||
} | ||
} | ||
var location = decodeURIComponent(matches[1]); | ||
var title = decodeURIComponent(matches[2]); | ||
|
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)