mirror of
https://github.com/coder/code-server.git
synced 2026-05-26 14:17:28 +02:00
chore(vscode): update to 1.55.2
This commit is contained in:
@@ -686,10 +686,29 @@ var AMDLoader;
|
||||
}
|
||||
WorkerScriptLoader.prototype.load = function (moduleManager, scriptSrc, callback, errorback) {
|
||||
var trustedTypesPolicy = moduleManager.getConfig().getOptionsLiteral().trustedTypesPolicy;
|
||||
if (trustedTypesPolicy) {
|
||||
scriptSrc = trustedTypesPolicy.createScriptURL(scriptSrc);
|
||||
var isCrossOrigin = (/^((http:)|(https:)|(file:))/.test(scriptSrc) && scriptSrc.substring(0, self.origin.length) !== self.origin);
|
||||
if (!isCrossOrigin) {
|
||||
// use `fetch` if possible because `importScripts`
|
||||
// is synchronous and can lead to deadlocks on Safari
|
||||
fetch(scriptSrc).then(function (response) {
|
||||
if (response.status !== 200) {
|
||||
throw new Error(response.statusText);
|
||||
}
|
||||
return response.text();
|
||||
}).then(function (text) {
|
||||
text = text + "\n//# sourceURL=" + scriptSrc;
|
||||
var func = (trustedTypesPolicy
|
||||
? self.eval(trustedTypesPolicy.createScript('', text))
|
||||
: new Function(text));
|
||||
func.call(self);
|
||||
callback();
|
||||
}).then(undefined, errorback);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (trustedTypesPolicy) {
|
||||
scriptSrc = trustedTypesPolicy.createScriptURL(scriptSrc);
|
||||
}
|
||||
importScripts(scriptSrc);
|
||||
callback();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user