Skip to content
Advertisement

How to open a new PWA window from inside the PWA?

I’m trying to open a new window of my PWA application inside of it. But when I click on the anchor a new chrome tab is open.

Anyone can help me to open two instances of my PWA application?

An example of it is outlook, where you can open a new window of the application to write your email.

Thanks

Advertisement

Answer

The solution was very easy, I just need to open the new window using the window.open, and not using the anchor tag (A).

Documentation about this function:

https://developer.mozilla.org/pt-PT/docs/Web/API/Window/open

For this to work, you have to pass width and height attributes, I couldn’t find any documentation for that requirement, but it just works, example:

window.open('https://my.app.domain/route.to/something', null, 'width=600,height=400');
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement