New issue
Advanced search Search tips

Issue 734880 link

Starred by 7 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug

Blocking:
issue 660384



Sign in to add a comment

URL constructor does not support unknown protocols

Reported by m...@bfred.it, Jun 20 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.104 Safari/537.36

Steps to reproduce the problem:
1. Execute: new URL('git://github.com').hostname

What is the expected behavior?
It should return "github.com"

What went wrong?
It returns ""

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 59.0.3071.104  Channel: stable
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 26.0 r0

Firefox 54 matches this buggy behavior.

Safari 10.1 works correctly.
Node's URL implementation works correctly.
Node's "whatwg-url" package also works correctly.
 

Comment 1 by m...@bfred.it, Jun 20 2017

For reference, here's the Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1374505

Comment 2 by jochen@chromium.org, Jun 20 2017

Components: -Blink>JavaScript Blink>Network
Labels: -Pri-2 Pri-3
Status: Available (was: Unconfirmed)
DoResolveRelative() used by KURL has a special path for schemes not listed in kStandardURLSchemes. Ones with "git" scheme enter that path and cannot recognize that part as hostname.
Labels: Hotlist-Interop
Blocking: 660384
Repro website: https://felixfbecker.github.io/whatwg-url-custom-host-repro/
Filed on https://github.com/webcompat/web-bugs/issues/19792
Files on Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=902253
Specific test case added in https://github.com/web-platform-tests/wpt/pull/13516 (although also already covered in existing tests)

Firefox and Chrome both misbehave, while Edge, Safari, Node and whatwg-url behave spec-compliant.

This makes the URL API unreliable to use for generic URL parsing and always requires us to polyfill it (which is pretty big).

Sign in to add a comment