Open regseb opened 6 years ago
We had this and had to remove it due to the security story being rather involved. You can use new URLSearchParams(location.search)
and then set it after manipulation.
@annevk, could you say more, for posterity? I don't recall the security aspects, just that it was hard to hook it the mutable object up to the navigation stuff.
@domenic https://blog.whatwg.org/windowproxy-window-and-location has some detail on why Location
is special. Any kind of tearoff object it holds would need similar protections or be kept safe through equivalent manners (perhaps by replacing it a lot, but that might make it less useful for the use case and inconsistent with URL
).
Yeah, I think we'd need to basically create a parallel LocationSearchParams object. Which is a lot of work for medium gain. So that's basically the answer...
Add the attribute
searchParams
onLocation
interface which returns aURLSearchParams
class. Like theURL
class.