When viewed using the host 127.0.0.1, this page has a sandboxed iframe whose security origin matches the main frame.
The iframe has a beforeunload handler, and that handler should result in the display of the page dismissal dialog since allow-modals is set.