Bug 668307. Minimum loadURI support for remote content in Firefox. r=dao
authorFelipe Gomes <felipc@gmail.com>
Fri, 01 Jul 2011 00:39:04 -0300
changeset 72628 beceddeee3f4cc4c9fbea2b372cfdb7928ce805e
parent 72627 56b17efbb62b11281548110eda86c97b3b98e56e
child 72629 9f451a1901ddec8f5d3e4003845f5ca3683ab0a7
push id159
push usereakhgari@mozilla.com
push dateTue, 16 Aug 2011 17:53:11 +0000
treeherdermozilla-beta@8786e3e49240 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs668307
milestone7.0a1
first release with
nightly linux32
beceddeee3f4 / 7.0a1 / 20110701030757 / files
nightly linux64
beceddeee3f4 / 7.0a1 / 20110701030757 / files
nightly mac
beceddeee3f4 / 7.0a1 / 20110701030757 / files
nightly win32
beceddeee3f4 / 7.0a1 / 20110701030757 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 668307. Minimum loadURI support for remote content in Firefox. r=dao
browser/base/content/browser.js
browser/base/content/content.js
browser/base/jar.mn
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1410,16 +1410,18 @@ function prepareForStartup() {
     if (!webNavigation)
       throw "no XBL binding for browser";
   } catch (e) {
     alert("Error launching browser window:" + e);
     window.close(); // Give up.
     return;
   }
 
+  messageManager.loadFrameScript("chrome://browser/content/content.js", true);
+
   // initialize observers and listeners
   // and give C++ access to gBrowser
   gBrowser.init();
   XULBrowserWindow.init();
   window.QueryInterface(Ci.nsIInterfaceRequestor)
         .getInterface(nsIWebNavigation)
         .QueryInterface(Ci.nsIDocShellTreeItem).treeOwner
         .QueryInterface(Ci.nsIInterfaceRequestor)
new file mode 100644
--- /dev/null
+++ b/browser/base/content/content.js
@@ -0,0 +1,47 @@
+# -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is multi-process front-end code.
+#
+# The Initial Developer of the Original Code is
+# the Mozilla Foundation
+# Portions created by the Initial Developer are Copyright (C) 2011
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Felipe Gomes <felipc@gmail.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+const Ci = Components.interfaces;
+
+const webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation);
+
+addMessageListener("WebNavigation:LoadURI", function(message) {
+  let flags = message.json.flags || webNavigation.LOAD_FLAGS_NONE;
+
+  webNavigation.loadURI(message.json.uri, flags, null, null, null);
+});
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -24,16 +24,17 @@ browser.jar:
         content/browser/aboutHome-snippet1.png        (content/aboutHome-snippet1.png)
         content/browser/aboutHome-snippet2.png        (content/aboutHome-snippet2.png)
         content/browser/aboutRobots-icon.png          (content/aboutRobots-icon.png)
         content/browser/aboutRobots-widget-left.png   (content/aboutRobots-widget-left.png)
 *       content/browser/browser.css                   (content/browser.css)
 *       content/browser/browser.js                    (content/browser.js)
 *       content/browser/browser.xul                   (content/browser.xul)
 *       content/browser/browser-tabPreviews.xml       (content/browser-tabPreviews.xml)
+*       content/browser/content.js                    (content/content.js)
 *       content/browser/fullscreen-video.xhtml        (content/fullscreen-video.xhtml)
         content/browser/highlighter.xhtml             (content/highlighter.xhtml)
 *       content/browser/inspector.html                (content/inspector.html)
 *       content/browser/scratchpad.xul                (content/scratchpad.xul)
 *       content/browser/scratchpad.js                 (content/scratchpad.js)
 *       content/browser/pageinfo/pageInfo.xul         (content/pageinfo/pageInfo.xul)
 *       content/browser/pageinfo/pageInfo.js          (content/pageinfo/pageInfo.js)
 *       content/browser/pageinfo/pageInfo.css         (content/pageinfo/pageInfo.css)