src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.ts/WebExtensionsScannerService/toWebExtension
class WebExtensionsScannerService:	private async toWebExtension(extensionLocation: URI, identifier?: IExtensionIdentifier, packageNLSUris?: Map<string, URI>, bundleNLSUris?: Map<string, URI>, fallbackPackageNLSUri?: URI | null, readmeUri?: URI, changelogUri?: URI, metadata?: Metadata): Promise<IWebExtension> {
		let manifest: IExtensionManifest;
		try {
			manifest = await this.getExtensionManifest(extensionLocation);
		} catch (error) {
			throw new Error(`Error while fetching manifest from the location '${extensionLocation.toString()}'. ${getErrorMessage(error)}`);
		}

		if (!this.extensionManifestPropertiesService.canExecuteOnWeb(manifest)) {
			throw new Error(localize('not a web extension', "Cannot add '{0}' because this extension is not a web extension.", manifest.displayName || manifest.name));
		}

		if (fallbackPackageNLSUri === undefined) {
			try {
				fallbackPackageNLSUri = joinPath(extensionLocation, 'package.nls.json');
				await this.extensionResourceLoaderService.readExtensionResource(fallbackPackageNLSUri);
			} catch (error) {
				fallbackPackageNLSUri = undefined;
			}
		}
		const defaultManifestTranslations: ITranslations | null | undefined = fallbackPackageNLSUri ? await this.getTranslations(fallbackPackageNLSUri) : null;

		if (bundleNLSUris === undefined && manifest.browser) {
			const englishStringsUri = joinPath(
				this.uriIdentityService.extUri.dirname(joinPath(extensionLocation, manifest.browser)),
				'nls.metadata.json'
			);

			try {
				await this.extensionResourceLoaderService.readExtensionResource(englishStringsUri);
				bundleNLSUris = new Map();
				bundleNLSUris.set('en', englishStringsUri);
			} catch (error) {
				// noop if file doesn't exist
			}
		}

		return {
			identifier: { id: getGalleryExtensionId(manifest.publisher, manifest.name), uuid: identifier?.uuid },
			version: manifest.version,
			location: extensionLocation,
			manifest,
			readmeUri,
			changelogUri,
			packageNLSUris,
			bundleNLSUris,
			fallbackPackageNLSUri: fallbackPackageNLSUri ? fallbackPackageNLSUri : undefined,
			defaultManifestTranslations,
			metadata,
		};
	}