From e26fd1845054d7696f104e60e317be7767e95423 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Thu, 26 May 2022 09:39:30 -0600 Subject: [PATCH] fx-compat: Change autocomplete-input load method --- .../content/zotero/elements/shadowAutocompleteInput.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/elements/shadowAutocompleteInput.js b/chrome/content/zotero/elements/shadowAutocompleteInput.js index 5d5a5aaa71..a42cd1781b 100644 --- a/chrome/content/zotero/elements/shadowAutocompleteInput.js +++ b/chrome/content/zotero/elements/shadowAutocompleteInput.js @@ -26,10 +26,11 @@ "use strict"; { - var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); - - // Load specific element because customElements.js loads on element creation only - Services.scriptloader.loadSubScript("chrome://global/content/elements/autocomplete-input.js", this); + // The autocomplete-input CE is defined lazily. Create one now to get + // autocomplete-input defined, allowing us to inherit from it. + if (!customElements.get("autocomplete-input")) { + delete document.createXULElement("autocomplete-input"); + } /** * Extends AutocompleteInput to fix document.activeElement checks that