Skip to content

v2 - Content Security Policy prevents vscode-java-test from working #901

@chrischabot

Description

@chrischabot

The ms vscode java test runner extension inlines jquery-3.3.1.slim.min.js and a number of css files to generate it's view.

This was working fine while running 1.33.1, however using the latest v2 webview branch it's now generating content security policy errors when it tries to load those, creating the following error in chrome:

main.js:385 Refused to load the script 'http://localhost:8080/webview/vscode-resource/usr/local/extensions/vscjava.vscode-java-test-0.18.2/resources/templates/js/jquery-3.3.1.slim.min.js' because it violates the following Content Security Policy directive: "script-src vscode-resource: 'unsafe-inline'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

The full console output:

Screenshot 2019-08-13 at 22 49 48

And the code which is doing the loading:

Screenshot 2019-08-13 at 22 50 33

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions