I am writing a Javascript which runs in the browser using Tampermonkey.
The logic in the script is as follows. 1. Do some checks. 2. If a certain condition is met, then trigger an alert box in the browser.
Currently the alert box is shown in the browser tab, but amidst multiple tabs, the user does not notice the alert box till they navigate to the tab.
I am trying to figure out one or both of the following. 1. Bring the tab to the front i.e. focus on that tab. 2. Do something more aggressive than the alert box to catch user's attention. I thought of things such as playing sounds etc but it requires on user's speakers being on etc.
Any ideas on how to make this work would be greatly appreciated.