From b4a2f090480f7d20bf74fccf8aadc3bf53dff64e Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Tue, 26 Jun 2012 17:18:10 +0200 Subject: [PATCH] Bug 767978 - Create an shistory object for top-level b2g mozbrowser. r=bz --HG-- extra : rebase_source : 55b956588fe6e2fb8dc7aa71b48c88c522ec1cbc --- b2g/chrome/content/shell.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index 87efb4981f7..8416f1ea38d 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -111,6 +111,12 @@ var shell = { browserFrame.setAttribute('src', "data:text/html;charset=utf-8,%3C!DOCTYPE html>%3Cbody style='background:black;"); document.getElementById('shell').appendChild(browserFrame); + browserFrame.contentWindow + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIWebNavigation) + .sessionHistory = Cc["@mozilla.org/browser/shistory;1"] + .createInstance(Ci.nsISHistory); + ['keydown', 'keypress', 'keyup'].forEach((function listenKey(type) { window.addEventListener(type, this, false, true); window.addEventListener(type, this, true, true);