Fix link opening from the add-on manager window, r=clokep.
This commit is contained in:
Родитель
a320455866
Коммит
533f44c7c9
|
@ -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 () {
|
||||
|
|
Загрузка…
Ссылка в новой задаче