content icon indicating copy to clipboard operation
content copied to clipboard

WorkerGlobalScope.importScripts URLs relative to what base URL?

Open stbergmann opened this issue 1 year ago • 1 comments

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts

What specific section or headline is this issue about?

Syntax: Parameters

What information was incorrect, unhelpful, or incomplete?

If the URL is relative, it is relative to the HTML document's base URL.

Is it really the HTML document's base URL that is being used here? I didn't manage to drill down to the bottom of the https://spec.whatwg.org/ specs, but from some experiments it looks like what is being used here as base URL by recent Chrome and Firefox at least, is the URL of the script with which the given worker was constructed.

What did you expect to see?

not 100% sure what I expect, see above; that's why I ask

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
  • Folder: en-us/web/api/workerglobalscope/importscripts
  • MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts
  • GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/api/workerglobalscope/importscripts/index.md
  • Last commit: https://github.com/mdn/content/commit/542ef6cfd82288925e0a9238b47933f03e2dddca
  • Document last modified: 2023-08-04T05:38:55.000Z

stbergmann avatar Aug 23 '24 12:08 stbergmann

I believe you are right: it should be relative to the worker's URL.

Josh-Cena avatar Aug 23 '24 14:08 Josh-Cena