Merge from vscode e558dc6ea73a75bd69d7a0b485f0e7e4194c66bf (#6864)

This commit is contained in:
Anthony Dresser
2019-08-21 20:44:59 -07:00
committed by GitHub
parent d2ae0f0154
commit 985bfae8a0
107 changed files with 2260 additions and 814 deletions

View File

@@ -1186,22 +1186,14 @@ export function animate(fn: () => void): IDisposable {
return toDisposable(() => stepDisposable.dispose());
}
const _location = URI.parse(window.location.href);
RemoteAuthorities.setPreferredWebSchema(/^https:/.test(window.location.href) ? 'https' : 'http');
export function asDomUri(uri: URI): URI {
if (!uri) {
return uri;
}
if (Schemas.vscodeRemote === uri.scheme) {
if (platform.isWeb) {
// rewrite vscode-remote-uris to uris of the window location
// so that they can be intercepted by the service worker
return _location.with({ path: '/vscode-remote', query: JSON.stringify(uri) });
} else {
return RemoteAuthorities.rewrite(uri.authority, uri.path);
}
return RemoteAuthorities.rewrite(uri.authority, uri.path);
}
return uri;
}