Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

beforeunload event issue in Mac safari browser

3192588Jun 29 2017 — edited Jul 7 2017

I am facing an issue in handling the browser window close in javascript (i.e window/tab close button) for Safari browser (Mac and IPad).

I have a javascript function rdcBeforeUnLoadAction to logout the application and show a confirmation alert before closing the window. rdcBeforeUnLoadAction is called on beforeunload event from adf in clientListener as below.

<af:clientListener method="rdcBeforeUnLoadAction" type="beforeunload"/>

Browsers behavior:

  1.   IE11 - It works as expected, it logs out the application and shows the alert.
  2.   Safari (Mac Book) – It shows the alert with options (Stay on Page and Leave Page)

The issue here is that the logout does not happen on Leave page and the alert message is returned and displayed. So is there any way to handle this so that the application logs out on browser window close?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 4 2017
Added on Jun 29 2017
2 comments
689 views