Bug 1323987 - Update browser printing code accordingly. r=mconley
authorMatheus Longaray <mlongaray@hp.com>
Thu, 05 Jan 2017 17:38:13 +0100
changeset 373290 f372fe9889cd9cc14a4a98c2132f8f85d5e1272d
parent 373289 997080796cd305648854145038d2a6bfc9d2dcc1
child 373291 43bb3f70c4d0d2a74de07aa1d6788d7b598fe7ce
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1323987
milestone54.0a1
Bug 1323987 - Update browser printing code accordingly. r=mconley This patch updates browser printing code to make use of about:printpreview when loading new tab for print preview. The same URI is used when the user makes use of simplify page feature while print previewing. MozReview-Commit-ID: DXHT71hpnWo
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3431,28 +3431,28 @@ var PrintPreviewListener = {
   _tabBeforePrintPreview: null,
   _simplifyPageTab: null,
 
   getPrintPreviewBrowser() {
     if (!this._printPreviewTab) {
       let browser = gBrowser.selectedBrowser;
       let preferredRemoteType = browser.remoteType;
       this._tabBeforePrintPreview = gBrowser.selectedTab;
-      this._printPreviewTab = gBrowser.loadOneTab("about:blank", {
+      this._printPreviewTab = gBrowser.loadOneTab("about:printpreview", {
         inBackground: false,
         preferredRemoteType,
         sameProcessAsFrameLoader: browser.frameLoader
       });
       gBrowser.selectedTab = this._printPreviewTab;
     }
     return gBrowser.getBrowserForTab(this._printPreviewTab);
   },
   createSimplifiedBrowser() {
     let browser = this._tabBeforePrintPreview.linkedBrowser;
-    this._simplifyPageTab = gBrowser.loadOneTab("about:blank", {
+    this._simplifyPageTab = gBrowser.loadOneTab("about:printpreview", {
       inBackground: true,
       sameProcessAsFrameLoader: browser.frameLoader
      });
     return this.getSimplifiedSourceBrowser();
   },
   getSourceBrowser() {
     return this._tabBeforePrintPreview ?
       this._tabBeforePrintPreview.linkedBrowser : gBrowser.selectedBrowser;