문제

I have an application that is a portal which links to other apps. The links open up those apps with a target='app-name' so that if they open it again and the window exists, it opens in the same window.

However, while in the app, we have a link to go back to the portal window but that window has no 'target=portal' tag...it opened up first - let's say via a bookmark. So when the link is clicked, we get a new portal tab/window...now we have two. The users want us to find the existing one.

So how do I 'name' the portal window so I can get back to it with a target='portal'?

도움이 되었습니까?

해결책

You can try

window.name = 'portal';

According to MDN article about window.name,

Gets/sets the name of the window.
The name of the window is used primarily for setting targets for hyperlinks and forms.

Be aware it's DOM Level 0, not part of any standard.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top