| Index: lib/notification.js |
| =================================================================== |
| --- a/lib/notification.js |
| +++ b/lib/notification.js |
| @@ -214,17 +214,31 @@ let Notification = exports.Notification |
| if (Prefs.notifications_ignoredcategories.indexOf("*") != -1) |
| continue; |
| } |
| if (typeof url === "string" || notification.urlFilters instanceof Array) |
| { |
| if (Prefs.enabled && typeof url === "string" && notification.urlFilters instanceof Array) |
| { |
| - let host = (typeof URL == "function" ? new URL(url).hostname : Utils.makeURI(url).host); |
| + let host; |
| + if (typeof URL == "function") |
| + host = new URL(url).hostname; |
| + else |
| + { |
| + try |
| + { |
| + host = Services.io.newURI(url, null, null).host; |
| + } |
| + catch (e) |
| + { |
| + // Ignore, an exception is excepted for about: and similar schemes |
|
Thomas Greiner
2015/11/10 17:54:19
Detail: I suppose you meant to write "expected" he
Wladimir Palant
2015/11/11 07:49:27
Yes, I fixed that before pushing.
|
| + host = ""; |
| + } |
| + } |
| let exception = defaultMatcher.matchesAny(url, RegExpFilter.typeMap.DOCUMENT, host, false, null); |
| if (exception instanceof WhitelistFilter) |
| continue; |
| let matcher = new Matcher(); |
| for (let urlFilter of notification.urlFilters) |
| matcher.add(Filter.fromText(urlFilter)); |
| if (!matcher.matchesAny(url, RegExpFilter.typeMap.DOCUMENT, host, false, null)) |