Skip to content

Commit f4a65c8

Browse files
committed
fixup! remove origin in getLoader
1 parent 460c7b9 commit f4a65c8

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/browser/pages/vscode.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export function getNlsConfiguration(_document: Document, base: string) {
9393
}
9494

9595
type GetLoaderParams = {
96-
origin: string
9796
nlsConfig: NlsConfiguration
9897
options: Options
9998
_window: Window
@@ -136,14 +135,14 @@ export function _createScriptURL(value: string, origin: string): string {
136135
* We extracted the logic into a function so that
137136
* it's easier to test.
138137
**/
139-
export function getConfigurationForLoader({ origin, nlsConfig, options, _window }: GetLoaderParams) {
138+
export function getConfigurationForLoader({ nlsConfig, options, _window }: GetLoaderParams) {
140139
const loader: Loader = {
141140
// Without the full URL VS Code will try to load file://.
142-
baseUrl: `${origin}${options.csStaticBase}/lib/vscode/out`,
141+
baseUrl: `${window.location.origin}${options.csStaticBase}/lib/vscode/out`,
143142
recordStats: true,
144143
trustedTypesPolicy: (_window as FixMeLater).trustedTypes?.createPolicy("amdLoader", {
145144
createScriptURL(value: string): string {
146-
return _createScriptURL(value, origin)
145+
return _createScriptURL(value, window.location.origin)
147146
},
148147
}),
149148
paths: {
@@ -239,7 +238,6 @@ export function main(_document: Document | undefined, _window: Window | undefine
239238
nlsConfig,
240239
options,
241240
_window,
242-
origin: _window.location.origin,
243241
})
244242

245243
;(self.require as unknown as Loader) = loader

test/unit/browser/pages/vscode.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ describe("vscode", () => {
208208
}
209209
const loader = getConfigurationForLoader({
210210
options,
211-
origin: "localhost",
212211
nlsConfig: nlsConfig,
213212
_window: global.window,
214213
})
@@ -274,7 +273,6 @@ describe("vscode", () => {
274273
}
275274
const loader = getConfigurationForLoader({
276275
options,
277-
origin: "localhost",
278276
nlsConfig: nlsConfig,
279277
_window: global.window,
280278
})

0 commit comments

Comments
 (0)