Skip to content Skip to sidebar Skip to footer

How To Show Custom Pop Up When Detect Browser Close Event?

I am trying to find window/tab close event in Google Chrome. In goole chrome, unload() is not working. So i used javascript

Solution 1:

You cannot. Imagine an advertiser adding code to display a popup advert when the window is closed, or a trickster adding a popup which has "OK" and "Cancel" reversed or non-functional; it's back to the old days of the internet when browsers were too trusting and users were left occasionally needing to force-quit the browser just to escape a page.

To prevent it, these days sites are allowed to display a block of text within a standard popup. You have no more control than that.

The best proof I can offer is this: go to an online email provider and close the window while uploading something, or jsfiddle and close the window after editing something, or any major site where you can edit things without an autosave. Notice that they use the browser-standard popup. If there were an alternative, one of them would have used it.

Post a Comment for "How To Show Custom Pop Up When Detect Browser Close Event?"