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 86389 14fc66cf01c92b40f1fc2b518ba71fcadc5c8bb2
parent 86388 c447fb3ea5473cf318bacfa1121d9ad63d0d32ac
child 86390 3138246355dcded4e08e143a6f613bf5f435dc01
child 86395 09b34423d61cd1d3ec367800825934552e1fbd50
child 86398 41e7738adee2070b2a3f77c4c32ad40110a0c6c7
push id10717
push userbenc@thunderbird.net
push dateFri, 27 Mar 2020 02:13:08 +0000
treeherdertry-comm-central@f505e51d8741 [default view] [failures only]
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;