Index: include.postload.js |
=================================================================== |
--- a/include.postload.js |
+++ b/include.postload.js |
@@ -610,22 +610,28 @@ |
// Search the link associated with the click |
var link = event.target; |
- while (link && !(link instanceof HTMLAnchorElement)) |
+ while (!(link instanceof HTMLAnchorElement)) |
+ { |
link = link.parentNode; |
- if (!link || link.protocol != "abp:") |
+ if (!link) |
+ return; |
+ } |
+ |
+ if (link.protocol == "http:" || link.protocol == "https:") |
kzar
2015/03/25 14:09:29
(Do we even need to support http? I guess we will
Sebastian Noack
2015/03/25 14:21:04
We probably will. But others linking to our websit
|
+ { |
+ if (link.host != "subscribe.adblockplus.org" || link.pathname != "/") |
+ return; |
+ } |
+ else if (!/^abp:\/*subscribe\/*\?(.*)/i.test(link.href)) |
Thomas Greiner
2015/03/25 15:05:36
The `(.*)` at the end of the regular expression is
Wladimir Palant
2015/03/25 15:07:17
Nit: Please remove the parentheses in this regexp
Sebastian Noack
2015/03/25 15:23:26
Done.
|
return; |
// This is our link - make sure the browser doesn't handle it |
event.preventDefault(); |
event.stopPropagation(); |
- var linkTarget = link.href; |
- if (!/^abp:\/*subscribe\/*\?(.*)/i.test(linkTarget)) /**/ |
- return; |
- |
// Decode URL parameters |
- var params = RegExp.$1.split("&"); |
+ var params = link.search.substr(1).split("&"); |
Wladimir Palant
2015/03/25 15:07:17
Note that this change will make the approach incon
Sebastian Noack
2015/03/25 15:23:26
Well, the alternative would be to make things inco
|
var title = null; |
var url = null; |
for (var i = 0; i < params.length; i++) |