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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...