Skip to content

Commit

Permalink
web - bring CSP back differently
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Jun 19, 2019
1 parent c76027b commit 8a0e33a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
36 changes: 18 additions & 18 deletions src/vs/code/browser/workbench/workbench.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />

<head>
<meta charset="utf-8" />
<!-- Disable pinch zooming -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

<!-- Disable pinch zooming -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta http-equiv="Content-Security-Policy"
content="default-src 'none'; img-src 'self' https: data: blob: vscode-remote:; media-src 'none'; child-src 'self' {{WEBVIEW_ENDPOINT}}; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; connect-src 'self' ws: wss: https:; font-src 'self' blob: vscode-remote:;">

<!-- <meta http-equiv="Content-Security-Policy"
content="default-src 'none'; img-src 'self' https: data: blob: vscode-remote:; media-src 'none'; child-src 'self' {{WEBVIEW_ENDPOINT}}; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; connect-src 'self' https:; font-src 'self' blob: vscode-remote:;"> -->
<meta id="vscode-workbench-web-configuration" data-settings="{{WORKBENCH_WEB_CONGIGURATION}}">

<meta id="vscode-workbench-web-configuration" data-settings="{{WORKBENCH_WEB_CONGIGURATION}}">
<!-- Workaround to pass remote user data uri-->
<meta id="vscode-remote-user-data-uri" data-settings="{{REMOTE_USER_DATA_URI}}">
<!-- Workaround to pass remote connection token-->
<meta id="vscode-remote-connection-token" data-settings="{{CONNECTION_AUTH_TOKEN}}">
</head>
<!-- Workaround to pass remote user data uri-->
<meta id="vscode-remote-user-data-uri" data-settings="{{REMOTE_USER_DATA_URI}}">

<body class="vs-dark" aria-label="">
</body>
<!-- Workaround to pass remote connection token-->
<meta id="vscode-remote-connection-token" data-settings="{{CONNECTION_AUTH_TOKEN}}">
</head>

<!-- Require our AMD loader -->
<script src="./out/vs/loader.js"></script>
<body class="vs-dark" aria-label="">
</body>

<!-- Startup via workbench.js -->
<script src="./out/vs/code/browser/workbench/workbench.js"></script>
<!-- Require our AMD loader -->
<script src="./out/vs/loader.js"></script>

<!-- Startup via workbench.js -->
<script src="./out/vs/code/browser/workbench/workbench.js"></script>
</html>
4 changes: 3 additions & 1 deletion src/vs/code/browser/workbench/workbench.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
});

require(['vs/workbench/workbench.web.api'], function (api) {
api.create(document.body, JSON.parse(document.getElementById('vscode-workbench-web-configuration').getAttribute('data-settings')));
const options = JSON.parse(document.getElementById('vscode-workbench-web-configuration').getAttribute('data-settings'));

api.create(document.body, options);
});
})();

0 comments on commit 8a0e33a

Please sign in to comment.