Skip to content

addModule() + CSP: requires "blob:" in script-src or default-src #992

@VictorQueiroz

Description

@VictorQueiroz

Hi, thank you for this amazing library. It's been really nice to work with it. Recently after migrating the entire app to use the standardized-audio-context library, I'm facing a production-only problem (now I know it's due to CSP rules) while trying to add audio worklet.

If blob: is not added to script-src or default-src directives, we receive the following error with no extra warning when addModule is called:

DOMException: The user aborted a request.

I had to read the source code to find out it was changing the original source code of the worklet source file and using blob: protocol instead, without any warnings (at least I didn't find any).

It'd be helpful to see some warnings for those using strict CSP rules and maybe add the option to not change the source code of the original worklet file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions