Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/notification.js

Issue 29339343: Noissue - Removed redundant URL compatibility logic (Closed)
Patch Set: Always use URL Created April 4, 2016, 1:39 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/synchronizer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/notification.js
===================================================================
--- a/lib/notification.js
+++ b/lib/notification.js
@@ -220,20 +220,15 @@
if (Prefs.enabled && typeof url === "string" && notification.urlFilters instanceof Array)
{
let host;
- if (typeof URL == "function")
- host = new URL(url).hostname;
- else
+ try
{
- try
- {
- host = Services.io.newURI(url, null, null).host;
- }
- catch (e)
- {
- // Ignore, an exception is expected for about: and similar schemes
- host = "";
- }
+ host = new URL(url).host;
}
+ catch (e)
+ {
+ host = "";
+ }
+
let exception = defaultMatcher.matchesAny(url, RegExpFilter.typeMap.DOCUMENT, host, false, null);
if (exception instanceof WhitelistFilter)
continue;
« no previous file with comments | « no previous file | lib/synchronizer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld