Stop music if tab is not active SOLVED

Good afternoon, can I stop the sound of a music file if the tab in the browser with the game is not in focus?

Sorry, I found an extension that pauses the sound if the window is not in focus. It’s called: Pause then losing focus

Thanks for the update! Could you just change the title of your post to include [SOLVED] at the beginning so others know this post has been solved? Thanks!