web - preserve pathname in URL when opening windows or changing workspaces

This commit is contained in:
Benjamin Pasero
2019-09-18 19:23:34 +02:00
parent cd0f833fe0
commit bbb56dba81
2 changed files with 3 additions and 3 deletions

View File

@@ -241,7 +241,7 @@ export class SimpleWindowService extends Disposable implements IWindowService {
for (let i = 0; i < _uris.length; i++) {
const uri = _uris[i];
if ('folderUri' in uri) {
const newAddress = `${document.location.origin}/?folder=${uri.folderUri.path}`;
const newAddress = `${document.location.origin}${document.location.pathname}?folder=${uri.folderUri.path}`;
if (openFolderInNewWindow) {
window.open(newAddress);
} else {
@@ -249,7 +249,7 @@ export class SimpleWindowService extends Disposable implements IWindowService {
}
}
if ('workspaceUri' in uri) {
const newAddress = `${document.location.origin}/?workspace=${uri.workspaceUri.path}`;
const newAddress = `${document.location.origin}${document.location.pathname}?workspace=${uri.workspaceUri.path}`;
if (openFolderInNewWindow) {
window.open(newAddress);
} else {

View File

@@ -51,7 +51,7 @@ class BrowserExtensionHostDebugService extends ExtensionHostDebugChannelClient i
openExtensionDevelopmentHostWindow(args: ParsedArgs, env: IProcessEnvironment): Promise<void> {
// we pass the "ParsedArgs" as query parameters of the URL
let newAddress = `${document.location.origin}/?`;
let newAddress = `${document.location.origin}${document.location.pathname}?`;
let gotFolder = false;
const addQueryParameter = (key: string, value: string) => {