src/vs/workbench/services/extensionManagement/common/webExtensionsScannerService.ts/WebExtensionsScannerService/toWebExtensionFromLocation
class WebExtensionsScannerService:	private async toWebExtensionFromLocation(extensionLocation: URI, readmeUri?: URI, changelogUri?: URI): Promise<IWebExtension> {
		const packageJSONUri = joinPath(extensionLocation, 'package.json');
		const packageNLSUri: URI = joinPath(extensionLocation, 'package.nls.json');

		const [packageJSONResult, packageNLSResult] = await Promise.allSettled([
			this.requestService.request({ type: 'GET', url: packageJSONUri.toString() }, CancellationToken.None),
			this.requestService.request({ type: 'GET', url: packageNLSUri.toString() }, CancellationToken.None),
		]);

		if (packageJSONResult.status === 'rejected' || !isSuccess(packageJSONResult.value)) {
			throw new Error(`Cannot find the package.json from the location '${extensionLocation.toString()}'`);
		}

		const content = await asText(packageJSONResult.value);
		if (!content) {
			throw new Error(`Error while fetching package.json for extension '${extensionLocation.toString()}'. Server returned no content`);
		}

		const manifest = JSON.parse(content);
		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));
		}

		return {
			identifier: { id: getGalleryExtensionId(manifest.publisher, manifest.name) },
			version: manifest.version,
			location: extensionLocation,
			readmeUri,
			changelogUri,
			packageNLSUri: packageNLSResult.status === 'fulfilled' && isSuccess(packageNLSResult.value) ? packageNLSUri : undefined
		};
	}