Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to implement the browser close event ?

    Hi ,

    In my project having some user level specification validations, if PASS means we are supposed to allow the application to use and FAIL means we are explicitly closing the browser with some warning message. I've tried to implement the window.close() method in native JS across JAVA code which is shown below.

    Code:
     private native void closeBrwsrWndw() /*-{
            $wnd.close();
        }-*/;
    From my unit testing sort of code works well in IE but where as Firefox & Chrome is not behaving as expected.Is there any way to achieve from framework itself ?

    Let me know your thoughts!

    #2
    Generally, you can only close() a Window you've opened. If the browser doesn't let you do it, there's nothing we can do to help; the browser is stopping you for what it sees as security reasons, generally.

    Comment

    Working...
    X