Bug 1428529 - ensure window.opener.Preferences is defined; r=jaws

MozReview-Commit-ID: DNvpuQplNgb
This commit is contained in:
Myk Melez 2018-01-08 20:33:40 -08:00
Родитель 93dcf044db
Коммит ea1a751cdb
2 изменённых файлов: 11 добавлений и 1 удалений

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

@ -819,7 +819,16 @@ WindowHelper.prototype = {
});
}
Services.ww.registerNotification(windowObserver);
Services.ww.openWindow(null,
let browserWin = null;
if (Services.appinfo.OS !== "Darwin") {
// Retrieve the browser window so we can specify it as the parent
// of the dialog to simulate the way the user opens the dialog
// on Windows and Linux.
browserWin = Services.wm.getMostRecentWindow("navigator:browser");
}
Services.ww.openWindow(browserWin,
"chrome://browser/content/sanitize.xul",
"SanitizeDialog",
"chrome,titlebar,dialog,centerscreen,modal",

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

@ -302,6 +302,7 @@ const Preferences = window.Preferences = (function() {
// preferences, to pick up any edits a user may have made.
if (Preferences.type == "child" && window.opener &&
window.opener.Preferences &&
Services.scriptSecurityManager.isSystemPrincipal(window.opener.document.nodePrincipal)) {
// Try to find the preference in the parent window.
const preference = window.opener.Preferences.get(this.name);