This question is locked. New answers and comments are not allowed.
I am trying to stop the monitor when a user leaves an Eqatec monitored page. I hooked the event handler to do this, but it appears that monitor.status() reporting isStarted as false as soon as the XHR request is fired, rather than when it returns. How can I keep the user on the page long enough to stop the monitor?
window.addEventListener(
"beforeunload"
,
function
() {
page.monitor.stop();
//attempt to wait for async call to complete
for
(
var
i = 1; i < 100000; i++)
{
var
status = page.monitor.status();
if
(!status.isStarted)
{
return
"got it on the "
+ i +
" attempt"
;
}
}
return
"didn't get it"
;
});