mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 06:21:50 +01:00
web - workaround new window issue with pwa
This commit is contained in:
@@ -11,7 +11,6 @@ import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { request } from 'vs/base/parts/request/browser/request';
|
||||
import { isFolderToOpen, isWorkspaceToOpen } from 'vs/platform/windows/common/windows';
|
||||
import { isEqual } from 'vs/base/common/resources';
|
||||
import { isStandalone } from 'vs/base/browser/browser';
|
||||
|
||||
interface ICredential {
|
||||
service: string;
|
||||
@@ -223,7 +222,7 @@ class WorkspaceProvider implements IWorkspaceProvider {
|
||||
if (options?.reuse) {
|
||||
window.location.href = targetHref;
|
||||
} else {
|
||||
if (isStandalone) {
|
||||
if (this.isRunningInPWA()) { // TODO@ben figure out why browser.isStandalone would not work?
|
||||
window.open(targetHref, '_blank', 'toolbar=no'); // ensures to open another 'standalone' window!
|
||||
} else {
|
||||
window.open(targetHref);
|
||||
@@ -232,6 +231,10 @@ class WorkspaceProvider implements IWorkspaceProvider {
|
||||
}
|
||||
}
|
||||
|
||||
private isRunningInPWA(): boolean {
|
||||
return (window.matchMedia && window.matchMedia('(display-mode: standalone)').matches);
|
||||
}
|
||||
|
||||
private createTargetUrl(workspace: IWorkspace, options?: { reuse?: boolean, payload?: object }): string | undefined {
|
||||
|
||||
// Empty
|
||||
|
||||
Reference in New Issue
Block a user