diff --git a/src/content-script.ts b/src/content-script.ts index 67b3f1e7..1eabcb98 100644 --- a/src/content-script.ts +++ b/src/content-script.ts @@ -77,7 +77,11 @@ async function main() { const onOpenSavedRepliesButtonClick = async () => { // 6. Add the new replies to the saved reply dropdown const replyCategoriesDetailsMenus = await getSoon(() => - document.querySelectorAll(`.Overlay-body .js-saved-reply-menu`), + Array.from( + document.querySelectorAll(`.Overlay-body .js-saved-reply-menu`), + ) + .map((element) => element.parentNode) + .filter((x): x is ParentNode => !!x), ); for (const replyCategoriesDetailsMenu of replyCategoriesDetailsMenus) { @@ -151,10 +155,13 @@ async function main() { children: [ createElement("li", { children: [button], + className: "ActionListItem", + "data-targets": "action-list.items", role: "none", }), ], className: "js-saved-reply-menu ActionListWrap", + "data-view-component": true, role: "list", }), ); diff --git a/src/getSoon.ts b/src/getSoon.ts index e8efbd1b..3bbf42ec 100644 --- a/src/getSoon.ts +++ b/src/getSoon.ts @@ -1,4 +1,4 @@ -export async function getSoon( +export async function getSoon( getter: () => Value, ) { for (let i = 0; i < 100; i += 1) {