Skip to content

[metal-router] using window.onbeforeunload does not work for popstate events #65

@bryceosterhaus

Description

@bryceosterhaus

I tried to reproduce with just Senna.js and was unable to reproduce, so I think it is specific to metal-router.

Reproduction Steps

  1. Run demos
  2. Navigate around to a few pages
  3. Paste snippet in js console
    window.onbeforeunload = () => true
  4. Click on the "back" arrow in the browser

Expected Result
Browser prompts a warning that asks before going back

Actual Result
Does not navigate, JS error metal.js:9173 Uncaught TypeError: event.preventDefault is not a function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions