Confirm on close?

269 views
Skip to first unread message

Brandon Randall

unread,
Jun 18, 2016, 7:40:19 AM6/18/16
to PHP Desktop
Is there a way to prevent accidental closing of the main window?

I have used a javascript solution, but while it works when closing or navigating pages within PHPDesktop - it is ignored when using the right top close button.

Any solution?

cztomczak

unread,
Jun 19, 2016, 2:27:59 AM6/19/16
to PHP Desktop
Not possible currently.

Czarek Tomczak

unread,
Aug 27, 2016, 4:05:31 AM8/27/16
to PHP Desktop

hamye...@gmail.com

unread,
Apr 21, 2018, 6:33:43 PM4/21/18
to PHP Desktop
Any solution for Confirm on close

natta....@gmail.com

unread,
Nov 3, 2018, 2:12:21 PM11/3/18
to PHP Desktop
Here is an solution
Update setting.json
"start_fullscreen": true

1.Make a top navbar using HTML
2.Create a form
Example:
<form action="" method="get" onSubmit="return confirm('Do you wat to close this application?');">
<button name="close">close</button>
</form>
<?php
//here I use a trick to close application using PHP & Javascript
if(isset($_GET['close'])){
echo "<script>"; echo "window.close()"; echo "</script>";
}
?>

natta....@gmail.com

unread,
Nov 3, 2018, 2:14:41 PM11/3/18
to PHP Desktop
Reply all
Reply to author
Forward
0 new messages