Open RandomByte opened 8 years ago
I'm facing the same issue. Using beta Safari Version 10.0 (11602.1.32.7)
Same behavior using Safari Version 9.1.2 (11601.7.7) on El Capitan 10.11.6 (15G31)
Same problem here
Seems to be a Safari Bug. Same Problem here on Stack Overflow without a relation to AreYouSure http://stackoverflow.com/questions/37268874/beforeunload-not-working-in-safari-9-1-after-the-page-reloads-on-clicking-leave
Using the latest Safari, the user only gets prompted on the first refresh with unsaved changes. Any succeeding refreshes with unsaved form changes do not lead to a prompt.
I don't use this plugin, but see that it runs into the same issues I do with my (very similar) implementation. So maybe you guys have an idea.
Steps to reproduce
Chrome 9.1.1 on Mac OS X 10.11.5 (El Capitan)
-> "Are you sure you want to leave this page?" dialog appears
=> No dialog appears and the page gets reloaded
I suspect that this might be some kind of security measure introduced by Safari. In Chrome, all the succeeding dialogs have a little checkbox saying "Prevent this page from creating additional dialogs". Maybe the Safari developers decided to ditch any additional dialogs without asking the user (they do something similar with popup blocking).
In the latest release notes they only mention that they now use a generic string to prompt the user rather than the custom one supplied by the application.