From 13b9837524b5fa47c2f2c81a0be503326a3884ee Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 4 May 2022 06:40:38 -0400 Subject: [PATCH] fx-compat: Fix New Item menu and `serializePersist()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `document.getElementsByAttribute` → `document.querySelectorAll` --- chrome/content/zotero/zoteroPane.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 8b29c93fd1..9bf471501c 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -278,10 +278,10 @@ var ZoteroPane = new function() return; } - var addMenu = document.getElementById('zotero-tb-add').firstChild; + var addMenu = document.getElementById('zotero-tb-add').firstElementChild; // Remove all nodes so we can regenerate - var options = addMenu.getElementsByAttribute("class", "zotero-tb-add"); + var options = addMenu.querySelectorAll('.zotero-tb-add'); while (options.length) { var p = options[0].parentNode; p.removeChild(options[0]); @@ -5377,7 +5377,7 @@ var ZoteroPane = new function() catch (e) { serializedValues = {}; } - for (let el of document.getElementsByAttribute("zotero-persist", "*")) { + for (let el of document.querySelectorAll("[zotero-persist]")) { if (!el.getAttribute) continue; var id = el.getAttribute("id"); if (!id) continue;