workbench API: assumeGalleryExtensionsAreAddressable
This commit is contained in:
parent
e94e8ed399
commit
7a83e5aa62
2 changed files with 12 additions and 1 deletions
|
@ -267,6 +267,10 @@ export class WebExtensionsScannerService extends Disposable implements IWebExten
|
|||
}
|
||||
|
||||
canAddExtension(galleryExtension: IGalleryExtension): boolean {
|
||||
if (this.environmentService.options?.assumeGalleryExtensionsAreAddressable) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return !!galleryExtension.properties.webExtension && !!galleryExtension.webResource;
|
||||
}
|
||||
|
||||
|
@ -275,7 +279,7 @@ export class WebExtensionsScannerService extends Disposable implements IWebExten
|
|||
throw new Error(localize('cannot be installed', "Cannot install '{0}' because this extension is not a web extension.", galleryExtension.displayName || galleryExtension.name));
|
||||
}
|
||||
|
||||
const extensionLocation = galleryExtension.webResource!;
|
||||
const extensionLocation = joinPath(galleryExtension.assetUri, 'Microsoft.VisualStudio.Code.WebResources', 'extension');
|
||||
const packageNLSUri = joinPath(extensionLocation, 'package.nls.json');
|
||||
const context = await this.requestService.request({ type: 'GET', url: packageNLSUri.toString() }, CancellationToken.None);
|
||||
const packageNLSExists = isSuccess(context);
|
||||
|
|
|
@ -333,6 +333,13 @@ interface IWorkbenchConstructionOptions {
|
|||
*/
|
||||
readonly _enableBuiltinExtensions?: boolean;
|
||||
|
||||
/**
|
||||
* Allows the workbench to skip checking whether an extension was built for the web
|
||||
* and assumes they are addressable via the `Microsoft.VisualStudio.Code.WebResources`
|
||||
* asset URI.
|
||||
*/
|
||||
readonly assumeGalleryExtensionsAreAddressable?: boolean;
|
||||
|
||||
/**
|
||||
* Support for URL callbacks.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue