diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 2dafce40519d..18970e303672 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -4,7 +4,7 @@ #filter substitution -pref("toolkit.defaultChromeURI", "chrome://browser/content/shell.xul"); +pref("toolkit.defaultChromeURI", "chrome://browser/content/shell.html"); pref("browser.chromeURL", "chrome://browser/content/"); // Device pixel to CSS px ratio, in percent. Set to -1 to calculate based on display density. diff --git a/b2g/chrome/content/screen.js b/b2g/chrome/content/screen.js index 150d895a3b17..616eaa5f8b7a 100644 --- a/b2g/chrome/content/screen.js +++ b/b2g/chrome/content/screen.js @@ -11,7 +11,7 @@ window.addEventListener('ContentStart', function() { let shell = document.getElementById('shell'); // The element inside it - let browser = document.getElementById('homescreen'); + let browser = document.getElementById('systemapp'); // Figure out the native resolution of the screen let windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor) diff --git a/b2g/chrome/content/shell.html b/b2g/chrome/content/shell.html new file mode 100644 index 000000000000..8bab69a3bd7b --- /dev/null +++ b/b2g/chrome/content/shell.html @@ -0,0 +1,41 @@ + + + + + + + + + +#ifndef MOZ_WIDGET_GONK + + + + + +#endif + + +#ifdef MOZ_WIDGET_COCOA + +

wtf mac os!

+#endif + + + diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index f0e46503e7e0..d332323578e3 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -183,7 +183,7 @@ var shell = { get contentBrowser() { delete this.contentBrowser; - return this.contentBrowser = document.getElementById('homescreen'); + return this.contentBrowser = document.getElementById('systemapp'); }, get homeURL() { @@ -266,25 +266,29 @@ var shell = { } let manifestURL = this.manifestURL; - // - let browserFrame = + let systemAppFrame = document.createElementNS('http://www.w3.org/1999/xhtml', 'html:iframe'); - browserFrame.setAttribute('id', 'homescreen'); - browserFrame.setAttribute('mozbrowser', 'true'); - browserFrame.setAttribute('mozapp', manifestURL); - browserFrame.setAttribute('allowfullscreen', 'true'); - browserFrame.setAttribute('style', "overflow: hidden; -moz-box-flex: 1; border: none;"); - browserFrame.setAttribute('src', "data:text/html;charset=utf-8,%3C!DOCTYPE html>%3Cbody style='background:black;"); - document.getElementById('shell').appendChild(browserFrame); + systemAppFrame.setAttribute('id', 'systemapp'); + systemAppFrame.setAttribute('mozbrowser', 'true'); + systemAppFrame.setAttribute('mozapp', manifestURL); + systemAppFrame.setAttribute('allowfullscreen', 'true'); + systemAppFrame.setAttribute('style', "overflow: hidden; height: 100%; width: 100%; border: none;"); + systemAppFrame.setAttribute('src', "data:text/html;charset=utf-8,%3C!DOCTYPE html>%3Cbody style='background:black;"); + let container = document.getElementById('container'); +#ifdef MOZ_WIDGET_COCOA + container.removeChild(document.getElementById('placeholder')); +#endif + container.appendChild(systemAppFrame); - browserFrame.contentWindow - .QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIWebNavigation) - .sessionHistory = Cc["@mozilla.org/browser/shistory;1"] - .createInstance(Ci.nsISHistory); + systemAppFrame.contentWindow + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIWebNavigation) + .sessionHistory = Cc["@mozilla.org/browser/shistory;1"] + .createInstance(Ci.nsISHistory); // Capture all key events so we can filter out hardware buttons // And send them to Gaia via mozChromeEvents. diff --git a/b2g/chrome/content/shell.xul b/b2g/chrome/content/shell.xul deleted file mode 100644 index adb8e710b867..000000000000 --- a/b2g/chrome/content/shell.xul +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - -