Fix link opening from the add-on manager window, r=clokep.

This commit is contained in:
Florian Quèze 2011-06-07 14:14:24 +02:00
Родитель a320455866
Коммит 533f44c7c9
1 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -51,6 +51,21 @@ var addonsRegister = {
window.removeEventListener("load", addonsRegister.onload, false);
window.addEventListener("unload", addonsRegister.onunload, false);
let win = document.getElementById("dummychromebrowser").contentWindow;
let open = win.open;
win.open = function(aUrl) {
let uri = Services.io.newURI(aUrl, null, null);
// http and https are the only schemes that are exposed even
// though we don't handle them internally.
if (!uri.schemeIs("http") && !uri.schemeIs("https"))
open.apply(this, arguments);
else {
Cc["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Ci.nsIExternalProtocolService).loadUrl(uri);
}
};
},
onunload: function () {