Bug 1025146 - Make viewing the source of a page or frame via the context menu work with remote browsers. r=jryans.
authorMike Conley <mconley@mozilla.com>
Fri, 08 May 2015 17:04:30 -0400
changeset 243484 28c41c53d0c24528bd3c7050a93939189c3b3a83
parent 243483 13bf99d217bf4485bda6a77a7d93b6c9b3618acf
child 243485 485ce3fb3fa81086348743475d756788c90b183f
push id59683
push usercbook@mozilla.com
push dateTue, 12 May 2015 15:13:10 +0000
treeherdermozilla-inbound@ed36c6879944 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1025146
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1025146 - Make viewing the source of a page or frame via the context menu work with remote browsers. r=jryans.
browser/base/content/browser-context.inc
browser/base/content/nsContextMenu.js
--- a/browser/base/content/browser-context.inc
+++ b/browser/base/content/browser-context.inc
@@ -372,17 +372,17 @@
                 label="&viewPartialSourceForMathMLCmd.label;"
                 accesskey="&viewPartialSourceCmd.accesskey;"
                 oncommand="gContextMenu.viewPartialSource('mathml');"
                 observes="isImage"/>
       <menuseparator id="context-sep-viewsource"/>
       <menuitem id="context-viewsource"
                 label="&viewPageSourceCmd.label;"
                 accesskey="&viewPageSourceCmd.accesskey;"
-                oncommand="BrowserViewSourceOfDocument(gContextMenu.browser.contentDocumentAsCPOW);"
+                oncommand="BrowserViewSource(gContextMenu.browser);"
                 observes="isImage"/>
       <menuitem id="context-viewinfo"
                 label="&viewPageInfoCmd.label;"
                 accesskey="&viewPageInfoCmd.accesskey;"
                 oncommand="gContextMenu.viewInfo();"/>
       <menuseparator id="spell-separator"/>
       <menuitem id="spell-check-enabled"
                 label="&spellCheckToggle.label;"
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -988,17 +988,21 @@ nsContextMenu.prototype = {
     var docUrl = null;
     window.openDialog("chrome://global/content/viewPartialSource.xul",
                       "_blank", "scrollbars,resizable,chrome,dialog=no",
                       docUrl, docCharset, reference, aContext);
   },
 
   // Open new "view source" window with the frame's URL.
   viewFrameSource: function() {
-    BrowserViewSourceOfDocument(this.target.ownerDocument);
+    BrowserViewSourceOfDocument({
+      browser: this.browser,
+      URL: gContextMenuContentData.docLocation,
+      outerWindowID: gContextMenuContentData.frameOuterWindowID,
+    });
   },
 
   viewInfo: function() {
     BrowserPageInfo(this.target.ownerDocument.defaultView.top.document);
   },
 
   viewImageInfo: function() {
     BrowserPageInfo(this.target.ownerDocument.defaultView.top.document,