-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow URL objects when starting workers #8698
base: main
Are you sure you want to change the base?
Conversation
The documentation you linked to looks good for |
It's hard to find examples for this. The reason why passing an URL object works is that it is stringified and Webpack example for SharedWorker: https://github.com/webpack/webpack/blob/c181294865dca01b28e6e316636fef5f2aad4eb6/examples/worker/example.js#L25-L31 The arguments for https://w3c.github.io/ServiceWorker/#idl-index |
@mvitousek What do you think? As far as I can tell, Flow already does what I'm proposing here for Line 1511 in f9afdbc
Line 1601 in f9afdbc
But the spec actually doesn't say that it can be a typedef (Request or USVString) RequestInfo;
interface Request {
constructor(RequestInfo input, optional RequestInit init = {});
...
}
...
fetch(RequestInfo input, optional RequestInit init = {}); |
Any news regarding this ? |
Passing URL object into worker construtors/
navigator.serviceWorker.register
should be allowedFor example described here: https://webpack.js.org/guides/web-workers/