New issue
Advanced search Search tips

Issue 736682 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Jun 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

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.
 
chrome bug.JPG
46.9 KB View Download

Comment 1 by tkent@chromium.org, Jun 26 2017

Components: -Blink Blink>Network

Comment 2 by woxxom@gmail.com, 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
Status: WontFix (was: Unconfirmed)
I think #2 is correct.
even that doesn't work, from specification 

let params = new URLSearchParams({key: "730d67"})
params.toString()


this result in : 
"%5Bobject+Object%5D="

Comment 5 by woxxom@gmail.com, Aug 10 2017

#4, it works in Chrome 61+, see https://www.chromestatus.com/features/5737549880360960

Sign in to add a comment