Index: lib/utils.js |
=================================================================== |
--- a/lib/utils.js |
+++ b/lib/utils.js |
@@ -55,9 +55,22 @@ |
}, |
makeURI: function(url) |
{ |
- return Services.io.newURI(url); |
+ let urlObj; |
+ try |
+ { |
+ urlObj = new URL(url); |
+ } |
+ catch (e) |
Sebastian Noack
2016/04/04 11:22:26
We previously didn't handle exceptions here, but w
|
+ { |
+ return null; |
+ } |
+ |
+ return { |
+ spec: urlObj.href, |
+ scheme: urlObj.protocol, |
+ host: urlObj.hostname |
+ }; |
}, |
- |
checkLocalePrefixMatch: function(prefixes) |
{ |
if (!prefixes) |