Bug 1442840, r=bgrins

--HG--
extra : rebase_source : dc87379c22ac47eee13e1ffec6dbff67afb6e2b0
This commit is contained in:
Gijs Kruitbosch 2018-03-08 20:45:00 +00:00
parent 8f0a6f777d
commit a9e1b0e919

View File

@ -88,7 +88,14 @@ define(function(require, exports, module) {
return Rep(Object.assign({}, props, {
cropLimit: 50,
noGrip: true,
openLink: url => window.open(url, "_blank"),
openLink(str) {
try {
let u = new URL(str);
if (u.protocol == "https:" || u.protocol == "http:") {
window.open(str, "_blank");
}
} catch (ex) { /* the link might be bust, then we do nothing */ }
},
}));
}