'Chrome Browser Issue With Java Script beforeunload function

I have this simple piece of code.

$(window).bind('beforeunload', function () {

    var c = confirm();
    if (c) {
        return true;
    }
    else {
        return false;
    }

});

Its works great with Chrome browser in all systems except one. I don't understand why it's not working in that particular system.

This issue came with only one system (But its working fine in same system in Incognito mode).

System Configuration:
OS: Windows
Browser: Chrome (Latest Version).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source