URLSearchParams is not detecting parameters in URL correctly
Reported by
myemailu...@gmail.com,
Jun 26 2017
|
||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Steps to reproduce the problem:
1. In chrome console type this:
var b = new URLSearchParams('https://www.youtube.com/watch?v=gYjHDMPrkWU&t=1193s');
var c = [...b.entries()];
2. Now look at value of c[0]
What is the expected behavior?
Instead of having an array like this ["v" ,"gYjHDMPrkWU"],
you get an array like this: ["https://www.youtube.com/watch?v" ,"gYjHDMPrkWU"]
What went wrong?
["https://www.youtube.com/watch?v" ,"gYjHDMPrkWU"]
Did this work before? N/A
Chrome version: 58.0.3029.110 Channel: n/a
OS Version: 10.0
Flash Version:
however, new URL('..url..').searchParams , works fine.
,
Jun 26 2017
This is working according to the specification. Only the leading "?" is stripped automatically so you can provide URL's ".search", but not the entire URL. Spec: https://url.spec.whatwg.org/#urlsearchparams
,
Jun 26 2017
I think #2 is correct.
,
Aug 10 2017
even that doesn't work, from specification
let params = new URLSearchParams({key: "730d67"})
params.toString()
this result in :
"%5Bobject+Object%5D="
,
Aug 10 2017
#4, it works in Chrome 61+, see https://www.chromestatus.com/features/5737549880360960 |
||
►
Sign in to add a comment |
||
Comment 1 by tkent@chromium.org
, Jun 26 2017