Bug 1466349 part 2 - Pass addonData to embedded Screenshots WE, add permissions r=aswan,ianbicking
authorTomislav Jovanovic <tomica@gmail.com>
Sun, 03 Jun 2018 00:25:56 +0200
changeset 421374 e04c7ccfd50e5877126c28aad60336b267189dc5
parent 421373 b84f57938f8b9db2412180da78f6fb3e16380cb3
child 421375 0bb149ce1d1a4167e7135bb8a093ebdcf1ac0595
push id34092
push useraiakab@mozilla.com
push dateTue, 05 Jun 2018 21:57:17 +0000
treeherdermozilla-central@0bb149ce1d1a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan, ianbicking
bugs1466349
milestone62.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 1466349 part 2 - Pass addonData to embedded Screenshots WE, add permissions r=aswan,ianbicking MozReview-Commit-ID: GLwjp32sj2i
browser/extensions/screenshots/bootstrap.js
browser/extensions/screenshots/webextension/manifest.json
--- a/browser/extensions/screenshots/bootstrap.js
+++ b/browser/extensions/screenshots/bootstrap.js
@@ -116,19 +116,20 @@ const LibraryButton = {
     item.setAttribute("label", this.LABEL);
 
     parent.insertBefore(item, nextSibling);
   },
 };
 
 const APP_STARTUP = 1;
 const APP_SHUTDOWN = 2;
-let startupReason;
+let addonData, startupReason;
 
 function startup(data, reason) { // eslint-disable-line no-unused-vars
+  addonData = data;
   startupReason = reason;
   if (reason === APP_STARTUP) {
     appStartupObserver.register();
   } else {
     appStartupDone();
   }
   prefObserver.register();
   addonResourceURI = data.resourceURI;
@@ -172,17 +173,17 @@ function handleStartup() {
   if (!shouldDisable() && !webExtension.started) {
     start(webExtension);
   } else if (shouldDisable()) {
     stop(webExtension, ADDON_DISABLE);
   }
 }
 
 function start(webExtension) {
-  return webExtension.startup(startupReason).then((api) => {
+  return webExtension.startup(startupReason, addonData).then((api) => {
     api.browser.runtime.onMessage.addListener(handleMessage);
     LibraryButton.init(webExtension);
     initPhotonPageAction(api, webExtension);
   }).catch((err) => {
     // The startup() promise will be rejected if the webExtension was
     // already started (a harmless error), or if initializing the
     // WebExtension failed and threw (an important error).
     console.error(err);
--- a/browser/extensions/screenshots/webextension/manifest.json
+++ b/browser/extensions/screenshots/webextension/manifest.json
@@ -58,11 +58,13 @@
     "downloads",
     "tabs",
     "storage",
     "notifications",
     "clipboardWrite",
     "contextMenus",
     "mozillaAddons",
     "<all_urls>",
-    "https://screenshots.firefox.com/"
+    "https://screenshots.firefox.com/",
+    "resource://pdf.js/",
+    "about:reader*"
   ]
 }