The documentation states that "Safari 5.1 sends an "activate" event to a window or tab whenever it is activated". I use the following code in my global page to capture this event:
function onWindowOrTabSwitched(event) {
alert("onWindowOrTabSwitched");
}
safari.application.addEventListener("activate", onWindowOrTabSwitched, true);
The alert shows when I switch from one tab to the other, but when switching between Safari windows, most of the time, nothing happens. Is there something I'm doing wrong or doesn't Safari (6.0.2) not dispatching this event on switching between windows?