Skip to content

Should strict MIME type for importScripts() also be enforced on local URLs? #8869

Closed

Description

@Kaiido

#4001 set up a strict MIME type enforcement for importScripts(). However while all UAs seem to have agreed about external URLs, and tests are written for these, there is a compat issue regarding local URLs (data: and blob:).

Both Chrome and Firefox seem to not look at the MIME type of such URLs, while Safari and if I read correctly, the specs, do throw on these too. Quick test cases: data: URL, and blob: URL.

I'm not sure what would be the best here. These being local might warrant a special case (e.g I wouldn't be surprised to see a blob: URL pointing to a dynamically created script on which the type wasn't set).

Originally posted in #4001 (comment)

Activity

  1. annevk commented on Feb 9, 2023

    @annevk
    Member
  2. added a commit that references this issue on Feb 9, 2023
  3. evilpie commented on Feb 10, 2023

    @evilpie
    Member

    We don't have any telemetry in Firefox for importScripts or new Worker with data:, blob: etc. with non JS MIME types, so that would be best to add first.

  4. added a commit that references this issue on Mar 28, 2023
  5. evilpie commented on Mar 29, 2023

    @evilpie
    Member

    Probably not a deal breaker, but this caused a regression in emscripten: emscripten-core/emscripten#19080 (https://bugzilla.mozilla.org/show_bug.cgi?id=1824839)

  6. annevk commented on Mar 26, 2025

    @annevk
    Member

    Since we have test coverage through web-platform-tests/wpt#38430 at this point this is just a bug in Chromium.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interopImplementations are not interoperable with each othertopic: workers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions