Skip to content

Add support for URL object instance in History.pushState() and History.replaceState() #1621

@sohailalam2

Description

@sohailalam2

Describe the bug

History.pushState(state, title, url) and History.replaceState(state, title, url) APIs technically accepts a string or an URL object as the last parameter.

However, while passing URL object, happy-dom throws an exception because of the string comparison methods being used in BrowserFrameURL.getRelativeURL() # line 18

To Reproduce
As described above ☝️

Expected behavior
History APIs should allow for an URL object.

Screenshots
NA

Device:

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions