Implemented the YouTubeMusicObserverEmitter, which is responsible for watching for when the player state, current song, or queue changes so the mini player can stay up-to-date. I was able to subscribe to some changes from the player object, but other state changes like the like/dislike, volume, seek, repeat button, and queue required using HTML element MutationObservers.
Added message types to the /background/messages dir so Plasmo can auto-generate the message.name type and updated the mainToBackground util to use that auto-generated type
Noticed a warning because we were using .innerHTML to set the style element. .innerText worked as well and didn't return any errors.
Overview
YouTubeMusicObserverEmitter
, which is responsible for watching for when the player state, current song, or queue changes so the mini player can stay up-to-date. I was able to subscribe to some changes from the player object, but other state changes like the like/dislike, volume, seek, repeat button, and queue required using HTML elementMutationObserver
s./background/messages
dir so Plasmo can auto-generate the message.name type and updated themainToBackground
util to use that auto-generated type