whatwg / html

HTML Standard
https://html.spec.whatwg.org/multipage/
Other
8.06k stars 2.65k forks source link

"Fetch a classic worker-imported script" uses fetch's synchronous flag, which is no longer defined #7804

Open Lubrsi opened 2 years ago

Lubrsi commented 2 years ago

https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-worker-imported-script

Let request be a new request whose URL is url, client is settings object, destination is "script", parser metadata is "not parser-inserted", synchronous flag is set, and whose use-URL-credentials flag is set.

The synchronous flag was removed from fetch here: https://github.com/whatwg/fetch/commit/12dd6fa8ca76bd3bdff0c65a0c5a84b3ca870c3d

annevk commented 2 years ago

What's currently step 12 of https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send defines a way to rewrite this. Essentially using the "pause" primitive and a boolean that gets flipped by a response callback algorithm. While a tad longer, it makes it a lot clearer what is going on.