Bug 1382572 - Display Android options_ui of newly installed WebExtensions when about:addons is opened. draft
authorLuca Greco <lgreco@mozilla.com>
Fri, 28 Jul 2017 14:58:44 +0200
changeset 617591 adecb018e758ad3033317745e2581914e7fd913c
parent 617493 758a925a8699b4718f21168991e20e190aa40e38
child 639853 fd6301fcf1c6be1e90c559dbabba98c7ace13ce5
push id71091
push userluca.greco@alcacoop.it
push dateFri, 28 Jul 2017 17:55:26 +0000
bugs1382572
milestone56.0a1
Bug 1382572 - Display Android options_ui of newly installed WebExtensions when about:addons is opened. MozReview-Commit-ID: HbTghvTdQ28
mobile/android/chrome/content/aboutAddons.js
--- a/mobile/android/chrome/content/aboutAddons.js
+++ b/mobile/android/chrome/content/aboutAddons.js
@@ -354,17 +354,21 @@ var Addons = {
     let optionsURL = aListItem.getAttribute("optionsURL");
 
     // Always clean the options content before rendering the options of the
     // newly selected extension.
     optionsBox.innerHTML = "";
 
     switch (parseInt(addon.optionsType)) {
       case AddonManager.OPTIONS_TYPE_INLINE_BROWSER:
-        this.createWebExtensionOptions(optionsBox, optionsURL, addon.optionsBrowserStyle);
+        // WebExtensions are loaded asynchronously and the optionsURL
+        // may not be available via listitem when the add-on has just been
+        // installed, but it is available on the addon if one is set.
+        detailItem.setAttribute("optionsURL", addon.optionsURL);
+        this.createWebExtensionOptions(optionsBox, addon.optionsURL, addon.optionsBrowserStyle);
         break;
       case AddonManager.OPTIONS_TYPE_INLINE:
         this.createInlineOptions(optionsBox, optionsURL, aListItem);
         break;
     }
 
     showAddonOptions();
   },