before unload event - how to change default message "Changes you made may not be saved"?
I created issue - so it would be cool if you know hot to show custom message and answer there
https://github.com/vercel/next.js/issues/60696
GitHub
before unload event - how to change default message "Changes you ma...
Link to the code that reproduces this issue https://github.com/nicitaacom/acc2-beforeunload-custom-message/blob/development/app/page.tsx To Reproduce git clone https://github.com/nicitaacom/acc2-be...
2 Replies
The browser unload event doesn't support customizing the popup: https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
You should note that modern implementations: [...] * Only show a generic browser-specified string in the displayed dialog. This cannot be controlled by the webpage code.likely as a security measure
As I understood your answer:
Probably due to security reasons it show only browser-specified string in
window.confirm
Ok thank you
I keep this question open for 7 days - then I close it as solved "Not editable"
Its not possible to change it