Triggering Data fetch while Plasmo not knowing about url change

my main focus on extension im building is videos (youtube), and my extension loads inside the videos, and i get extension data from an api by sending the video url that i get from window.location.href i can get it from dom too. with this way when we enter video because it doesnt know the video id and we rendered the extension from the youtube beggining, it shows all the data 0 because it didnt send the request to api (react query) how can we tell the component to wait for url change or dom change so when video id came, trigger the request and fill the data? note that when we enter a video from youtube.com it cant recognise this because of how youtube works, should i do things from background.ts? or watchOverlayAnchor? please help me
1 Reply
lab
lab•17mo ago
@itssina I'd do it in bgsw
Want results from more Discord servers?
Add your server