Skip to content

URL#origin is "null" when using file protocol which is different with browser #62643

@JounQin

Description

@JounQin

Version

v24.14.0

Platform

arwin JounQin---MacBook-Pro-Max.local 25.4.0 Darwin Kernel Version 25.4.0: Thu Mar 19 19:30:44 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T6000 arm64

Subsystem

No response

What steps will reproduce the bug?

new URL('file:///home/user/document.html#section')
URL {
  href: 'file:///home/user/document.html#section',
  origin: 'null',
  protocol: 'file:',
  username: '',
  password: '',
  host: '',
  hostname: '',
  port: '',
  pathname: '/home/user/document.html',
  search: '',
  searchParams: URLSearchParams {},
  hash: '#section'
}

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

Image

Origin should be file://

What do you see instead?

"null"

Additional information

No response

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