Open new browser tab from BrowserWindowOpener immediatelly

Hi, i think the question is simple, but i can`t find workaround to achieve desired behaviour. =(

I use BrowserWindowOpener, that i add to Button.

So i have another button, that creates pdf file and set its as resource for window opener.

All works fine, file created and opened if i click on printOpenerButton, after clicking on pdfCreator Button.

But, if i call right after windowOpener.serResource(pdf) (inside pdfCreator Button click Listener); A new Tab doesn`t appear. =(

So, how can i trigger open tab from window opener from code ? I missed something ?


the reason this doesn’t work is that works on the server side only, whereas the BrowserWindowOpener works on the client side - so the extension code is never run.

One option would be to call…) with relevant parameters but that could lead to a pop-up blocker preventing the new tab/window from opening. With the BrowserWindowOpener the new tab is opened directly from the click event on the client side. This makes sure the browser does not block it, but also prevents you from doing any server-side processing before the new window is opened.


Ok, i understand . Thank for help, Teppo !!!