Skip to content

Commit 4a20e6c

Browse files
committed
Wait dom on chat frame
1 parent 2573c95 commit 4a20e6c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/content-script.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ const updateMenuButton = () => {
5656
}
5757
}
5858

59-
const addMenuButton = () => {
60-
const header = document.querySelector(
59+
const addMenuButton = async () => {
60+
const header = await querySelectorAsync(
6161
'#chat-messages > yt-live-chat-header-renderer'
6262
)
6363
const refIconButton = header && header.querySelector('yt-icon-button')
@@ -302,7 +302,7 @@ document.addEventListener('DOMContentLoaded', async () => {
302302
enabled = data.enabled
303303
settings = data.settings
304304
updateRoot()
305-
addMenuButton()
306305
updateItems()
306+
await addMenuButton()
307307
await observe()
308308
})

0 commit comments

Comments
 (0)