Jump to content

Close Browser


WagnerAlexandre

Recommended Posts

JS:window.close();

 

This method is only allowed to be called for windows that were opened by a script using the window.open method. If the window was not opened by a script, the following error appears in the JavaScript Console: Scripts may not close windows that were not opened by script.

 

https://developer.mozilla.org/en-US/docs/Web/API/window.close

 

If you are using Mozilla Firefox, enter in the about:config and modify dom.allow_scripts_to_close_windows property to true, then you can use window.close()

...

Link to comment
Share on other sites

  • 2 years later...
I have situation where I would like to save silently some cookies for default browser. With certain QueryPamams I save cookies and terminate application in UniGUIMainModuleBeforeLogin:

UniSession.UniApplication.Terminate('<script>window.top.close()</script>');

 

But it is not allowed to close browser tab/window.

 

Instead redirect there works like below but it is not silet as I wish:

UniSession.Terminate('<script>window.location.href = "http://google.com";</script>');

 

Is there a way to close browser window or other ways to save cookies silently?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...