url-polyfill icon indicating copy to clipboard operation
url-polyfill copied to clipboard

IE11 object missing most fields

Open dmt0 opened this issue 4 years ago • 4 comments

Here's my example URL: https://dash.local/Auth/o/authorize/?response_type=token&client_id=eC5Tuezee6eebahn5xo9moo4edai2weepheethah&redirect_uri=https://dash.local/Manager/oauth2-redirect&state=Manager

When I parse it in Chrome:

hash: ""
host: "dash.local"
hostname: "dash.local"
href: "https://dash.local/Auth/o/authorize/?response_type=token&client_id=eC5Tuezee6eebahn5xo9moo4edai2weepheethah&redirect_uri=https://dash.local/Manager/oauth2-redirect&state=Manager"
origin: "https://dash.local"
password: ""
pathname: "/Auth/o/authorize/"
port: ""
protocol: "https:"
search: "?response_type=token&client_id=eC5Tuezee6eebahn5xo9moo4edai2weepheethah&redirect_uri=https://dash.local/Manager/oauth2-redirect&state=Manager"
searchParams: URLSearchParams {}
username: ""
__proto__: URL

When I parse it in IE11 (that thing won't let me copy/paste...):

image

host, hostname, protocol are all missing.

dmt0 avatar Dec 17 '20 21:12 dmt0

Got things working with this one for now: https://github.com/Financial-Times/polyfill-library/blob/master/polyfills/URL/polyfill.js

dmt0 avatar Dec 17 '20 22:12 dmt0

FWIW, was just experimenting with this polyfill and tried the URL you provided above, and it seems to parse correctly:

image

sashaweiss avatar Feb 18 '21 23:02 sashaweiss

Yeah, that's weird. Gonna give it another shot when I have my hands on IE again.

dmt0 avatar Feb 18 '21 23:02 dmt0