Control the close button of the browser ("X")

<< Click to Display Table of Contents >>

Navigation:  Forum >

Control the close button of the browser ("X")

Forum link

 


 

07-10-2020, 10:51 AM:

 

Hi,

 

Is it possible to block the closing of the browser ("X" button) before all the tasks are completed? (similar to the VCL forms OnCloseQuery event)

 

Thanks.

 


 

07-10-2020, 03:30 PM:

 

In general no.

 


 

07-13-2020, 10:23 AM:

 

No way you can do that. Browsers are created to avoid that JavaScript or any other trick can block the user from closing the page or the whole browser. Doesn't matter what trick you read on the internet, it won't work.