onbeforeunload



  • Puhlease incorporate native confirmation message when refreshing page or using back and forward buttons in Vivaldi. All other recent browsers have removed the customizable (javascript) confirmation message which is a good thing, they have, however, preserved a native message to warn users of possible data loss in the event of leaving a page. I use the following script to trigger the display of native message (Windows) in my app:

    // Display native confirmation message when exiting or reloading page
    window.onbeforeunload = function(){
    return true;
    };

    My SPA cannot be used on Vivaldi (v1.13,971.8 build) because the above code does not work. Is it my bad? I cannot promote Vivaldi as the best browser to use with my web software since Users could inadvertently lose all application data! Hopefully the next updates will provide the urgent required fix (fingers crossed). Keep up the good work!



  • Does it work in Chrome/Chromium? As Vivaldi uses both the rendering engine and javascript of Chromium, it would be hard for Vivaldi to support features that browser does not.



  • @jqdan said in onbeforeunload:

    onbeforeunload

    Known bug. VB-3984 "window.onbeforeunload event is firing but non-void return value is not prompting for confirm page"



  • @sgunhouse
    Chrome is a different beast. If you refresh the page that has no navigation history, it will reload page without warning, which is not good for data-driven applications. Only when navigation history is registered will Chrome open the native confirmation message.

    I'll see if programmatically controlling the history list prior to page reload will help for Chromium-based affected browsers. I only use latest browser tech for my xapp:
    https://developer.mozilla.org/en-US/docs/Web/API/History_API.



Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.