Bug 1624422 - Wait for loading to complete before changing Add-On Manager search box placeholder. r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 26 Mar 2020 20:07:18 +1300
changeset 38581 14fc66cf01c92b40f1fc2b518ba71fcadc5c8bb2
parent 38580 c447fb3ea5473cf318bacfa1121d9ad63d0d32ac
child 38582 41e7738adee2070b2a3f77c4c32ad40110a0c6c7
push id400
push userclokep@gmail.com
push dateMon, 04 May 2020 18:56:09 +0000
reviewersmkmelin
bugs1624422
Bug 1624422 - Wait for loading to complete before changing Add-On Manager search box placeholder. r=mkmelin
mail/base/content/aboutAddonsExtra.js
--- a/mail/base/content/aboutAddonsExtra.js
+++ b/mail/base/content/aboutAddonsExtra.js
@@ -30,16 +30,21 @@ const THUNDERBIRD_THEME_PREVIEWS = new M
     if (!/(interactive|complete)/.test(browser.contentDocument.readyState)) {
       await new Promise(resolve =>
         browser.contentWindow.addEventListener("DOMContentLoaded", resolve, {
           once: true,
         })
       );
     }
 
+    // Wait for custom elements and L10n.
+    await new Promise(resolve =>
+      browser.contentWindow.requestAnimationFrame(resolve)
+    );
+
     let textbox = browser.contentDocument.getElementById("search-addons");
     let placeholder = textbox.getAttribute("placeholder");
     placeholder = placeholder.replace(
       "addons.mozilla.org",
       "addons.thunderbird.net"
     );
     textbox.setAttribute("placeholder", placeholder);
     return;