polyfill icon indicating copy to clipboard operation
polyfill copied to clipboard

URL polyfill doesn't work in workers

Open ianloic opened this issue 8 years ago • 2 comments

The URL polyfill depends on document and/or window so it can't work in workers. Specifically I'm having issues with it in IE11 in a worker.

ianloic avatar Mar 16 '16 03:03 ianloic

FWIW, for my very simple uses (relative URL resolution) this seems to work: https://github.com/github/url-polyfill/blob/master/url.js

ianloic avatar Mar 16 '16 03:03 ianloic

Yeah, mine relies on an anchor tag to do the heavy lifting rather than reimplementing the browser's built in parser. That other one is missing most of the useful stuff like URLSearchParams.

inexorabletash avatar Mar 16 '16 15:03 inexorabletash