web - workaround new window issue with pwa
This commit is contained in:
parent
6d1ddf0730
commit
54a6229d68
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue