Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webview with "script-src vscode-resource:" fails to load #6296

Closed
akoliada opened this issue Sep 30, 2019 · 0 comments · Fixed by #6465
Closed

Webview with "script-src vscode-resource:" fails to load #6296

akoliada opened this issue Sep 30, 2019 · 0 comments · Fixed by #6465
Assignees
Labels
bug bugs found in the application webviews issues related to webviews

Comments

@akoliada
Copy link

akoliada commented Sep 30, 2019

Description

Webview with "script-src vscode-resource" Content Security Policy directive cannot be loaded properly as in URIs "vscode-resource:" is replaced with "/webview/".

Reproduction Steps

Sample plugin: https://marketplace.visualstudio.com/items?itemName=janisdd.vscode-edit-csv

  • Execute 'CSV: Edit as CSV' command having a CSV document opened.

OS and Theia version:
RHEL 7.6, latest

Diagnostics:
The error from the browser console: Refused to load the script 'https://<MY_HOSTNAME>/webview/tmp/vscode-unpacked/janisdd.vscode-edit-csv-0.1.4.vsix/extension/thirdParty/papaparse.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.

Note: Script URL can be opened in browser - the location is correct.

@akosyakov akosyakov added bug bugs found in the application help wanted issues meant to be picked up, require help webviews issues related to webviews labels Oct 1, 2019
@akosyakov akosyakov removed the help wanted issues meant to be picked up, require help label Oct 28, 2019
@akosyakov akosyakov self-assigned this Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application webviews issues related to webviews
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants