Wrap web worker extension host in an iframe to get a different origin

This commit is contained in:
Alex Dima
2020-08-03 14:52:53 +02:00
parent 532c7b1c78
commit f43a17578c
5 changed files with 238 additions and 69 deletions

View File

@@ -5,6 +5,7 @@
import * as nls from 'vs/nls';
import * as path from 'vs/base/common/path';
import * as platform from 'vs/base/common/platform';
import { originalFSPath, joinPath } from 'vs/base/common/resources';
import { Barrier, timeout } from 'vs/base/common/async';
import { dispose, toDisposable, DisposableStore, Disposable } from 'vs/base/common/lifecycle';
@@ -383,7 +384,14 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
subscriptions: [],
get extensionUri() { return extensionDescription.extensionLocation; },
get extensionPath() { return extensionDescription.extensionLocation.fsPath; },
asAbsolutePath(relativePath: string) { return path.join(extensionDescription.extensionLocation.fsPath, relativePath); },
asAbsolutePath(relativePath: string) {
if (platform.isWeb) {
// web worker
return URI.joinPath(extensionDescription.extensionLocation, relativePath).toString();
} else {
return path.join(extensionDescription.extensionLocation.fsPath, relativePath);
}
},
get storagePath() { return that._storagePath.workspaceValue(extensionDescription)?.fsPath; },
get globalStoragePath() { return that._storagePath.globalValue(extensionDescription).fsPath; },
get logPath() { return path.join(that._initData.logsLocation.fsPath, extensionDescription.identifier.value); },