Intent to Implement & Ship: throw on invalid URLs passed to window.open()

30 views
Skip to first unread message

Jochen Eisinger

unread,
May 4, 2017, 11:00:10 AM5/4/17
to blink-dev

Contact emails

joc...@chromium.org


Spec

https://html.spec.whatwg.org/multipage/#apis-for-creating-and-navigating-browsing-contexts-by-name:parse-a-url


Summary

To align with other APIs, window.open() should throw a DOMException "SyntaxError" when invoked with an invalid URL. Currently, it just returns null and logs a console message.


Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes


Interoperability and Compatibility Risk

UseCounter data suggests that nobody invokes window.open() with invalid URLs: https://www.chromestatus.com/metrics/feature/timeline/popularity/1909


Discussion took place here: https://github.com/whatwg/html/issues/2490 


Edge: No signals

Firefox: Public support

Safari: Public support

Web developers: No signals


Please include links where possible.


Is this feature fully tested by web-platform-tests?

Yes, but we don't import the url/ directory.


OWP launch tracking bug

Add crbug.com/708135


Entry on the feature dashboard

https://www.chromestatus.com/feature/5636515271016448

Jochen Eisinger

unread,
May 4, 2017, 11:01:00 AM5/4/17
to blink-dev
Small correction: Firefox and Edge already ship that but throw a different exception

Chris Harrelson

unread,
May 4, 2017, 11:05:48 AM5/4/17
to Jochen Eisinger, blink-dev
LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Mike West

unread,
May 4, 2017, 1:42:15 PM5/4/17
to Chris Harrelson, Jochen Eisinger, blink-dev
Non-OWNER's LGTM; aligning with Firefox and Edge seems like a good thing to do, and being more strict about URL parsing sounds like an even better thing to do. cdumez@ from WebKit is also on board with the plan: https://github.com/whatwg/html/issues/2490#issuecomment-290745646.

-mike

Rick Byers

unread,
May 4, 2017, 4:46:53 PM5/4/17
to Mike West, Philip Jägenstedt, Chris Harrelson, Jochen Eisinger, blink-dev
LGTM2.

Will you import the url/ WPT directory along with your change to enable this (should save you having to write your own LayoutTest)?

Philip Jägenstedt

unread,
May 5, 2017, 7:30:25 AM5/5/17
to Rick Byers, Mike West, Chris Harrelson, Jochen Eisinger, blink-dev
LGTM3

I have a CL for importing url/ and other network-related tests in https://codereview.chromium.org/2855023002/, we'll get this imported eventually.


-mike

LGTM1

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.



Reply all
Reply to author
Forward
0 new messages