I'm trying to have a popup over a page in Safari which is tab-specific, and triggered by a button (which can visibly toggled). How can I ensure that when a tab is switched to, the button will be correctly toggled, i.e. highlighted if the popup is visible; not otherwise.
I looked around for a "tab switch" kind of event to listen for but that didn't work, nor did focus.
Any ideas?
Cheers.