I have script like this:
<script language="JavaScript" type="text/javascript">
    function enter() {
        this.chrono = new Date().getMilliseconds();
    }
    function leave() {
        this.chrono = new Date().getMilliseconds() - this.chrono;
        alert("test" + this.chrono);
            var blockingRequest = new XMLHttpRequest();
            blockingRequest.open("GET", "visitor_log/ajax_store_visit_duration.php?visit_duration=" + this.chrono, false); // async = false
            blockingRequest.send();
        return null;
    }
    window.onload = enter;
    window.onbeforeunload = leave;
</script>
PHP part (visitor_log/ajax_store_visit_duration.php file):
<?php
if(isset($_GET["visit_duration"]))
{
    $text = $_GET["visit_duration"];
    logtxt($text);
    echo "OK";
}
else die("application error");
function logtxt($text)
{
    $myFile = "test.txt";
    $fh = fopen($myFile, 'wb');
    fwrite($fh, $text);
    fclose($fh);
}
?>
It works in Chrome perfectly, but it doesn't work in Opera.
How to make it cross-browser?