Bug 1079222 - deny fullscreen from the forget button, r=dolske

This commit is contained in:
Gijs Kruitbosch
2014-10-21 04:19:40 +01:00
parent 9d0c3c4a96
commit 0eea7debaa

View File

@@ -524,6 +524,20 @@ Sanitizer.prototype = {
let features = "chrome,all,dialog=no," + this.privateStateForNewWindow;
let newWindow = existingWindow.openDialog("chrome://browser/content/", "_blank",
features, defaultArgs);
#ifdef XP_MACOSX
function onFullScreen(e) {
newWindow.removeEventListener("fullscreen", onFullScreen);
let docEl = newWindow.document.documentElement;
let sizemode = docEl.getAttribute("sizemode");
if (!newWindow.fullScreen && sizemode == "fullscreen") {
docEl.setAttribute("sizemode", "normal");
e.preventDefault();
e.stopPropagation();
return false;
}
}
newWindow.addEventListener("fullscreen", onFullScreen);
#endif
// Window creation and destruction is asynchronous. We need to wait
// until all existing windows are fully closed, and the new window is
@@ -537,6 +551,9 @@ Sanitizer.prototype = {
return;
Services.obs.removeObserver(onWindowOpened, "browser-delayed-startup-finished");
#ifdef XP_MACOSX
newWindow.removeEventListener("fullscreen", onFullScreen);
#endif
newWindowOpened = true;
// If we're the last thing to happen, invoke callback.
if (numWindowsClosing == 0)