Bug 1382572 - Display Android options_ui of newly installed WebExtensions when about:addons is opened. r=mixedpuppy
authorLuca Greco <lgreco@mozilla.com>
Fri, 28 Jul 2017 14:58:44 +0200
changeset 420892 d7e7ebb85f9e7978403774bd86bd04f3a6f1827e
parent 420891 9408284f094afd5e07eb4acea49cbff29474c8ee
child 420893 58c1de79d494b91b1d70de5ae18833c8f297c3b7
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy
bugs1382572
milestone56.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 1382572 - Display Android options_ui of newly installed WebExtensions when about:addons is opened. r=mixedpuppy 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();
   },