File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ Our changes include:
111
111
- Add a ` code-server ` schema.
112
112
- Allow multiple extension directories (both user and built-in).
113
113
- Rewrite assets requested by the browser to use the base URL.
114
- - Modify the loader to use the base URL.
115
- - Modify the web socket to use the base URL and TLS if necessary.
114
+ - Modify the loader, websocket, webview, and service worker to use the URL of
115
+ the page as a base ( and TLS if necessary for the websocket) .
116
116
- Send client-side telemetry through the server.
117
117
- Add a file prefix to ignore for temporary files created during upload.
118
118
- Insert our upload service for use in editor windows and explorer.
Original file line number Diff line number Diff line change @@ -174,10 +174,10 @@ index 5b06636edb..60b508079a 100644
174
174
<!-- Require our AMD loader -->
175
175
<script src="./out/vs/loader.js"></script>
176
176
diff --git a/src/vs/code/browser/workbench/workbench.js b/src/vs/code/browser/workbench/workbench.js
177
- index 65fae7c82d..c9744007c9 100644
177
+ index 65fae7c82d..9a9b8bbe3b 100644
178
178
--- a/src/vs/code/browser/workbench/workbench.js
179
179
+++ b/src/vs/code/browser/workbench/workbench.js
180
- @@ -7,15 +7,20 @@
180
+ @@ -7,21 +7,26 @@
181
181
182
182
(function () {
183
183
@@ -205,6 +205,14 @@ index 65fae7c82d..c9744007c9 100644
205
205
}
206
206
});
207
207
208
+ require(['vs/workbench/workbench.web.api'], function (api) {
209
+ const options = JSON.parse(document.getElementById('vscode-workbench-web-configuration').getAttribute('data-settings'));
210
+ -
211
+ + options.webviewEndpoint = `${base}/webview/`;
212
+ api.create(document.body, options);
213
+ });
214
+ })();
215
+ \ No newline at end of file
208
216
diff --git a/src/vs/platform/environment/common/environment.ts b/src/vs/platform/environment/common/environment.ts
209
217
index a6c9eb9d11..3f8995b727 100644
210
218
--- a/src/vs/platform/environment/common/environment.ts
Original file line number Diff line number Diff line change @@ -469,7 +469,6 @@ export class MainServer extends Server {
469
469
const workspacePath = parsedUrl . query . workspace as string | undefined ;
470
470
const folderPath = ! workspacePath ? parsedUrl . query . folder as string | undefined || this . options . folderUri || cwd : undefined ;
471
471
const remoteAuthority = request . headers . host as string ;
472
- const webviewEndpoint = this . withBase ( request , "/webview/" ) ;
473
472
const transformer = getUriTransformer ( remoteAuthority ) ;
474
473
const options : Options = {
475
474
WORKBENCH_WEB_CONGIGURATION : {
@@ -480,7 +479,6 @@ export class MainServer extends Server {
480
479
? transformer . transformOutgoing ( URI . file ( sanitizeFilePath ( folderPath , cwd ) ) )
481
480
: undefined ,
482
481
remoteAuthority,
483
- webviewEndpoint,
484
482
} ,
485
483
REMOTE_USER_DATA_URI : transformer . transformOutgoing (
486
484
( this . services . get ( IEnvironmentService ) as EnvironmentService ) . webUserDataHome ,
@@ -497,7 +495,7 @@ export class MainServer extends Server {
497
495
for ( const key in options ) {
498
496
content = content . replace ( `"{{${ key } }}"` , `'${ JSON . stringify ( options [ key as keyof Options ] ) } '` ) ;
499
497
}
500
- content = content . replace ( ' {{WEBVIEW_ENDPOINT}}' , webviewEndpoint ) ;
498
+ content = content . replace ( " {{WEBVIEW_ENDPOINT}}" , "" ) ;
501
499
502
500
return { content, filePath } ;
503
501
}
You can’t perform that action at this time.
0 commit comments