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
--- 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;
}