diff --git a/xpfe/browser/resources/content/fastnav.js b/xpfe/browser/resources/content/fastnav.js index 039408e6fad6..65426dbc51cf 100644 --- a/xpfe/browser/resources/content/fastnav.js +++ b/xpfe/browser/resources/content/fastnav.js @@ -366,6 +366,10 @@ function Startup() // Perform default browser checking. checkForDefaultBrowser(); } + + if (document.getElementById("main-window").getAttribute("fullScreen") == "true") { + BrowserFullScreenEnter(); + } } function Shutdown() @@ -942,6 +946,52 @@ function OpenAddressbook() open("chrome://messenger/content/addressbook/addressbook.xul", "_blank", "chrome,menubar,toolbar,resizable"); } +var gFullScreen = false; + +function BrowserFullScreenToggle() +{ + // toggle the attributes as indicated in the fullScreenElementChanges table + var idx, attribute, value; + var element, currentValue + var fullScreenElementChanges = document.getElementById("fullScreenElementChanges"); + var next = fullScreenElementChanges.firstChild; + while (next) { + idx = next.getAttribute("idx"); + attribute = next.getAttribute("attribute"); + value = next.getAttribute("value"); + + element = document.getElementById(idx); + currentValue = element.getAttribute(attribute); + + if (value) { + element.setAttribute(attribute, value); + } else { + element.removeAttribute(attribute); + } + next.setAttribute("value", currentValue); + + next = next.nextSibling; + } + + // toggle and save the fullScreen indicator + gFullScreen = !gFullScreen; + document.getElementById("main-window").setAttribute("fullScreen", gFullScreen?"true":"false"); +} + +function BrowserFullScreenEnter() +{ + if (!gFullScreen) { + BrowserFullScreenToggle(); + } +} + +function BrowserFullScreenExit() +{ + if (gFullScreen) { + BrowserFullScreenToggle(); + } +} + function BrowserViewSource() { var focusedWindow = document.commandDispatcher.focusedWindow; diff --git a/xpfe/browser/resources/content/linkToolbarOverlay.xul b/xpfe/browser/resources/content/linkToolbarOverlay.xul index c5a4d790cd99..7a55d3be3cf6 100644 --- a/xpfe/browser/resources/content/linkToolbarOverlay.xul +++ b/xpfe/browser/resources/content/linkToolbarOverlay.xul @@ -79,6 +79,10 @@ + + + + titlemenuseparator="&mainWindow.titlemodifiermenuseparator;" windowtype="navigator:browser" width="640" height="480" - screenX="10" screenY="10" - persist="screenX screenY width height sizemode"> + screenX="10" screenY="10" fullScreen="false" + persist="screenX screenY width height sizemode fullScreen">