Skip to content

document.location.href should be updated before intercept handler is run. #40

@LEW21

Description

@LEW21

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure it has not already been reported

Version (i.e. v2.x.x)

1.0.1-alpha.209

Node.js version (i.e. 18.x, or N/A)

No response

Operating system

None

Operating system version (i.e. 20.04, 11.3, 10, or N/A)

No response

Description

As per MDN ("The URL has already changed"), the page URL should be already changed when the interception handler is called.

Steps to Reproduce

window.navigation.addEventListener('navigate', ev => {
	ev.intercept({
		async handler() {
			console.log(document.location.pathname)
		}
	})
})

window.navigation.navigate('/xyz')

Expected Behavior

In Chrome, this logs '/xyz'. With the polyfill, it logs whatever the pathname was before.

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