0

I'm learning how to make a Chrome extension, as I need to make a tool that consists of a video that appears every so often in a popup window, or it could be also in a new tab. The important thing is that I'm able to define the time when the video should popup, so I need something in my code that will be counting the time depending on the events. When you click on the extension button, the timer should be activated, and if you are active doing anything in the browser, then it will count 30 minutes and then popup a message and an option to watch a random video. My question is where in my code should I define this timer variable. My initial idea was to put it on the background page, so it is controlling there the time and events, but I'm seeing that in MV2 there was an option to use a background page with the property persistent: true, so that the program would stay active all the time, as I need a timer to define the moments that the video window appears. However, now that there is a migration to MV3, and it uses service workers, this option (persistent true) is no longer available. I would appreciate if somebody could give me some guidance on how to structure this Chrome extension. I need somewhere in the extension to have a timer that counts the time depending on the events that occur in the browser. I don't have much experience with JS and this is my first attempt to do a Chrome Extension. I really appreciate any help.

0 Answers0