-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should throw for window.open when URL fails to parse #2490
Comments
Should be "SyntaxError" DOMException for consistency with other APIs. |
@cdumez @jeisinger, thoughts? |
I'm willing to give it a try in WebKit if Blink is on board too. |
@annevk I'm fine with this—certainly easier to test for! |
I think we'd like to have some kind of indication of how many sites will be affected by this change before committing to ship it |
@jeisinger can you (find someone to) add a use counter? |
yeah, will do |
Great, thanks. Let me know when it reaches stable. Then we can also check httparchive instances that trigger the use counter (if there are any). |
|
Ah right. Hmmm. I suppose use counter + the fact that it already throws in 2 browsers should be enough. |
It already seems to throw somewhat unreliably due to the exceptions from navigate, but if we think it's safer to return null instead I'd be happy to align on that too. Currently neither behavior is defined (and instead something else is required). |
btw, looking at the blink sources, if you specify a target frame, then we'll return that frame instead of null for an invalid url. Is that expected? |
I tested that in the link given in the OP. I get |
sorry, I confused invalid with empty URL. For completeness, _parent and _top are treated differently by blink, so WPT should cover those cases as well |
Filed https://bugs.chromium.org/p/chromium/issues/detail?id=708135 to track this |
use counter is pretty much 0%: https://www.chromestatus.com/metrics/feature/timeline/popularity/1909 we can still wait until it hits stable channel, but I think it's ok to just move forward here |
I filed https://bugs.webkit.org/show_bug.cgi?id=171656 against WebKit. |
Both Edge and Gecko fire the wrong exception type, so bugs on them would be good too. |
See http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4996
Edge and Gecko throw some exception. WebKit and Chromium return null. We typically throw for APIs when URLs fail to parse, it seems reasonable to do that here as well.
cc @lyzadanger
The text was updated successfully, but these errors were encountered: