Bug 1403661 - stop Screenshots in Private Browsing; r?_6a68 draft
authorIan Bicking <ianb@colorstudy.com>
Wed, 27 Sep 2017 12:57:40 -0500
changeset 671251 60a05da67a87cc0da0525cd8fdbe15fc5677a5e9
parent 671250 6100472d3aa833dff22a4edb0934fe600f43ddb8
child 733475 44701c04dd9d412f3f8c25e1bebb11f5d07cf39d
push id81892
push userbmo:ianb@mozilla.com
push dateWed, 27 Sep 2017 17:58:07 +0000
reviewers_6a68
bugs1403661
milestone58.0a1
Bug 1403661 - stop Screenshots in Private Browsing; r?_6a68 bootstrap.js sends the tab ID with the Photon page action, but it doesn't have the complete set of information that the WebExtension tab object has Export of commit https://github.com/mozilla-services/screenshots/commit/3c6ad114d4dccaf99385e939d630ceb7eab7da1e MozReview-Commit-ID: F1o81MieEei
browser/extensions/screenshots/webextension/background/startBackground.js
--- a/browser/extensions/screenshots/webextension/background/startBackground.js
+++ b/browser/extensions/screenshots/webextension/background/startBackground.js
@@ -130,17 +130,19 @@ this.startBackground = (function() {
     // Set up this side of the Photon page action port.  The other side is in
     // bootstrap.js.  Ideally, in the future, WebExtension page actions and
     // Photon page actions would be one in the same, but they aren't right now.
     photonPageActionPort = browser.runtime.connect({ name: "photonPageActionPort" });
     photonPageActionPort.onMessage.addListener((message) => {
       switch (message.type) {
       case "click":
         loadIfNecessary().then(() => {
-          main.onClicked(message.tab);
+          return browser.tabs.get(message.tab.id);
+        }).then((tab) => {
+          main.onClicked(tab);
         }).catch((error) => {
           console.error("Error loading Screenshots:", error);
         });
         break;
       default:
         console.error("Unrecognized message:", message);
         break;
       }