You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the official documentation of the 'ScriptDialogOpening' event callback, the JS invocation shall be blocked in case you are requesting the deferral.
However, I noticed, that the deferral is completely useless for the 'beforeunload' kind.
Steps to reproduce:
declare 'AreDefaultScriptDialogsEnabled' setting false in code
Error behaviour:
Please note, that the ScriptDialogOpening event callback will be invoked, but regardless of fetching the deferral and/or invoking the Accept() function on the event args, the navigation will always take place.
Expected CORRECT behaviour:
The default JS dialog (shown upon setting 'AreDefaultScriptDialogsEnabled' to true) is showing a dialog with two options to either 'stay on the page', or to 'leave the page' and depending on the selection the navigation is either executed or aborted.
=> However, with the described error behaviour above in place, writing one's own code to reflect these two options won't be feasible (since the 'leave page' scenario will inevitably be the only outcome).
How to fix:
Just as for the other 3 kinds (alert, confirm & prompt) also for 'beforeunload', within the ScriptDialogOpening event callback, the deferral should block further execution and depending on calling the 'Accept()' function on the event args, the 'leave page' (accept was triggered) and 'stay on page' (accept was NOT triggered) options shall be reflected.
Affected version: 1.0.1185.39 (as used within Windows App SDK version 1.2.230217.4)
@TomPMoleman Thanks for the bug report. We have fixed the issue in Edge canary 115.0.1830.0+. Please validate and let us know if you have more questions.
According to the official documentation of the 'ScriptDialogOpening' event callback, the JS invocation shall be blocked in case you are requesting the deferral.
However, I noticed, that the deferral is completely useless for the 'beforeunload' kind.
Steps to reproduce:
Error behaviour:
Please note, that the ScriptDialogOpening event callback will be invoked, but regardless of fetching the deferral and/or invoking the Accept() function on the event args, the navigation will always take place.
Expected CORRECT behaviour:
The default JS dialog (shown upon setting 'AreDefaultScriptDialogsEnabled' to true) is showing a dialog with two options to either 'stay on the page', or to 'leave the page' and depending on the selection the navigation is either executed or aborted.
=> However, with the described error behaviour above in place, writing one's own code to reflect these two options won't be feasible (since the 'leave page' scenario will inevitably be the only outcome).
How to fix:
Just as for the other 3 kinds (alert, confirm & prompt) also for 'beforeunload', within the ScriptDialogOpening event callback, the deferral should block further execution and depending on calling the 'Accept()' function on the event args, the 'leave page' (accept was triggered) and 'stay on page' (accept was NOT triggered) options shall be reflected.
Affected version: 1.0.1185.39 (as used within Windows App SDK version 1.2.230217.4)
AB#44218030
The text was updated successfully, but these errors were encountered: