src/vs/base/common/network.ts/FileAccessImpl/asBrowserUri
class FileAccessImpl:	asBrowserUri(uriOrModule: URI | string, moduleIdToUrl?: { toUrl(moduleId: string): string }, __forceCodeFileUri?: boolean): URI {
		const uri = this.toUri(uriOrModule, moduleIdToUrl);

		// Handle remote URIs via `RemoteAuthorities`
		if (uri.scheme === Schemas.vscodeRemote) {
			return RemoteAuthorities.rewrite(uri);
		}

		let convertToVSCodeFileResource = false;

		// Only convert the URI if we are in a native context and it has `file:` scheme
		// and we have explicitly enabled the conversion (sandbox, or VSCODE_BROWSER_CODE_LOADING)
		if (platform.isNative && (__forceCodeFileUri || platform.isPreferringBrowserCodeLoad) && uri.scheme === Schemas.file) {
			convertToVSCodeFileResource = true;
		}

		// Also convert `file:` URIs in the web worker extension host (running in desktop) case
		if (uri.scheme === Schemas.file && typeof platform.globals.importScripts === 'function' && platform.globals.origin === 'vscode-file://vscode-app') {
			convertToVSCodeFileResource = true;
		}

		if (convertToVSCodeFileResource) {
			return uri.with({
				scheme: Schemas.vscodeFileResource,
				// We need to provide an authority here so that it can serve
				// as origin for network and loading matters in chromium.
				// If the URI is not coming with an authority already, we
				// add our own
				authority: uri.authority || this.FALLBACK_AUTHORITY,
				query: null,
				fragment: null
			});
		}

		return uri;
	}