|
19 | 19 | <meta id="vscode-remote-nls-configuration" data-settings="{{NLS_CONFIGURATION}}">
|
20 | 20 |
|
21 | 21 | <!-- Workbench Icon/Manifest/CSS -->
|
22 |
| - <link rel="icon" href="../static-{{COMMIT}}/src/browser/media/favicon.ico" type="image/x-icon" /> |
23 |
| - <link rel="manifest" href="../static-{{COMMIT}}/src/browser/media/manifest.json" crossorigin="use-credentials"> |
24 |
| - <link data-name="vs/workbench/workbench.web.api" rel="stylesheet" href="./static-{{COMMIT}}/out/vs/workbench/workbench.web.api.css"> |
25 |
| - <link rel="apple-touch-icon" href="../static-{{COMMIT}}/src/browser/media/code-server.png" /> |
| 22 | + <link rel="icon" href="{{BASE}}/static-{{COMMIT}}/src/browser/media/favicon.ico" type="image/x-icon" /> |
| 23 | + <link rel="manifest" href="{{BASE}}/static-{{COMMIT}}/src/browser/media/manifest.json" crossorigin="use-credentials"> |
| 24 | + <link data-name="vs/workbench/workbench.web.api" rel="stylesheet" href="{{VS_BASE}}/static-{{COMMIT}}/out/vs/workbench/workbench.web.api.css"> |
| 25 | + <link rel="apple-touch-icon" href="{{BASE}}/static-{{COMMIT}}/src/browser/media/code-server.png" /> |
26 | 26 | <meta name="apple-mobile-web-app-capable" content="yes">
|
27 | 27 |
|
28 | 28 | <!-- Prefetch to avoid waterfall -->
|
29 |
| - <link rel="prefetch" href="./static-{{COMMIT}}/node_modules/semver-umd/lib/semver-umd.js"> |
| 29 | + <link rel="prefetch" href="{{BASE}}/static-{{COMMIT}}/node_modules/semver-umd/lib/semver-umd.js"> |
30 | 30 | </head>
|
31 | 31 |
|
32 | 32 | <body aria-label="">
|
33 | 33 | </body>
|
34 | 34 |
|
35 | 35 | <!-- Startup (do not modify order of script tags!) -->
|
36 |
| - <!-- NOTE:coder: Modified to work against the current path and use the commit for caching. --> |
37 | 36 | <script>
|
38 |
| - // NOTE: Changes to inline scripts require update of content security policy |
39 |
| - const basePath = window.location.pathname.replace(/\/+$/, ''); |
40 |
| - const base = window.location.origin + basePath; |
| 37 | + const parts = window.location.pathname.replace(/^\//g, "").split("/") |
| 38 | + parts[parts.length - 1] = "{{VS_BASE}}" |
| 39 | + const url = new URL(window.location.origin + "/" + parts.join("/")) |
41 | 40 | const el = document.getElementById('vscode-remote-commit');
|
42 | 41 | const commit = el ? el.getAttribute('data-settings') : "";
|
43 |
| - const staticBase = base + '/static-' + commit; |
| 42 | + const staticBase = url.href + '/static-' + commit; |
44 | 43 | let nlsConfig;
|
45 | 44 | try {
|
46 | 45 | nlsConfig = JSON.parse(document.getElementById('vscode-remote-nls-configuration').getAttribute('data-settings'));
|
|
54 | 53 | // FIXME: Only works if path separators are /.
|
55 | 54 | const path = nlsConfig._resolvedLanguagePackCoreLocation
|
56 | 55 | + '/' + bundle.replace(/\//g, '!') + '.nls.json';
|
57 |
| - fetch(`${base}/resource/?path=${encodeURIComponent(path)}`) |
| 56 | + fetch(`${url.href}/resource/?path=${encodeURIComponent(path)}`) |
58 | 57 | .then((response) => response.json())
|
59 | 58 | .then((json) => {
|
60 | 59 | bundles[bundle] = json;
|
|
78 | 77 | 'vs/nls': nlsConfig,
|
79 | 78 | };
|
80 | 79 | </script>
|
81 |
| - <script src="./static-{{COMMIT}}/out/vs/loader.js"></script> |
82 |
| - <script src="./static-{{COMMIT}}/out/vs/workbench/workbench.web.api.nls.js"></script> |
83 |
| - <script src="./static-{{COMMIT}}/out/vs/workbench/workbench.web.api.js"></script> |
| 80 | + <script src="{{VS_BASE}}/static-{{COMMIT}}/out/vs/loader.js"></script> |
| 81 | + <script src="{{VS_BASE}}/static-{{COMMIT}}/out/vs/workbench/workbench.web.api.nls.js"></script> |
| 82 | + <script src="{{VS_BASE}}/static-{{COMMIT}}/out/vs/workbench/workbench.web.api.js"></script> |
84 | 83 | <!-- TODO@coder: This errors with multiple anonymous define calls (one is
|
85 | 84 | workbench.js and one is semver-umd.js). For now use the same method found in
|
86 | 85 | workbench-dev.html. Appears related to the timing of the script load events. -->
|
87 |
| - <!-- <script src="./static-{{COMMIT}}/out/vs/workbench/workbench.js"></script> --> |
| 86 | + <!-- <script src="{{VS_BASE}}/static-{{COMMIT}}/out/vs/workbench/workbench.js"></script> --> |
88 | 87 | <script>
|
89 |
| - // NOTE: Changes to inline scripts require update of content security policy |
90 | 88 | require(['vs/code/browser/workbench/workbench'], function() {});
|
91 | 89 | </script>
|
92 | 90 | </html>
|
0 commit comments