This may work and may not work
javascript:(function () {window.onbeforeunload = function() { return 1; };})()