2012-08-10 13:20:25 -07:00
|
|
|
/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-07-13 12:17:31 -07:00
|
|
|
|
2011-11-17 13:21:25 -08:00
|
|
|
let Cc = Components.classes;
|
|
|
|
let Ci = Components.interfaces;
|
|
|
|
let Cu = Components.utils;
|
2011-07-13 12:17:31 -07:00
|
|
|
|
|
|
|
// Bug 671101 - directly using webNavigation in this context
|
|
|
|
// causes docshells to leak
|
2012-09-25 11:44:40 -07:00
|
|
|
this.__defineGetter__("webNavigation", function () {
|
2011-07-13 12:17:31 -07:00
|
|
|
return docShell.QueryInterface(Ci.nsIWebNavigation);
|
|
|
|
});
|
|
|
|
|
2011-07-19 03:50:36 -07:00
|
|
|
addMessageListener("WebNavigation:LoadURI", function (message) {
|
2011-07-13 12:17:31 -07:00
|
|
|
let flags = message.json.flags || webNavigation.LOAD_FLAGS_NONE;
|
|
|
|
|
|
|
|
webNavigation.loadURI(message.json.uri, flags, null, null, null);
|
|
|
|
});
|
2011-07-28 13:20:52 -07:00
|
|
|
|
|
|
|
addMessageListener("Browser:HideSessionRestoreButton", function (message) {
|
|
|
|
// Hide session restore button on about:home
|
|
|
|
let doc = content.document;
|
|
|
|
let container;
|
|
|
|
if (doc.documentURI.toLowerCase() == "about:home" &&
|
|
|
|
(container = doc.getElementById("sessionRestoreContainer"))){
|
|
|
|
container.hidden = true;
|
|
|
|
}
|
|
|
|
});
|