1

How can we detect through PHP or maybe in node.js or other languages if a web page crashed (without the browser EXITing) so that when a user press the "reload" button on the "Aw Snap" page in chrome certain specific content inside the page can be shown in this particular case (crash case). In a crash without EXIT, a browser shows per example in Google Chrome the famous "Aw, Snap!" page.

I don't want to know how to capture if the user refreshed the page or the page reloaded which can be known quite easily with different methods [one example see this PHP this code which can detect if users refreshed the page on major desktop/mobile browsers except IE unfortunately this code does not capture a crash event and the fact that user might request again the same page after a crash. I tried using "register_shutdown_function", and some other maneuvers using connection PHP functions like "connection_aborted" etc... but with no success. I figure out a sloppy way through the use of session variables but probably there are better clever manoeuvres.

Any help or suggestion would be greatly appreciated. Any solution in nodejs will be also welcomed.

Community
  • 1
  • 1
HB87
  • 413
  • 7
  • 16

1 Answers1

1

web brower crash because too many process from your browser to PC of Client. this crash can't detected by php because PHP server scripting. and you have question.., why not use JS for detect crash of browser?, because JS created just for controller website,. if you force to checked that use ajax, node, etc you can't do that, why? because the problem comes suddenly

and detected crash browser from php is impossible.

Abdul Aziz Al Basyir
  • 1,104
  • 13
  • 28
  • Thanks Abdul Aziz. You mean even when the browser doesn't exit only the "snap" page is shown, there is no way at all? Even with other web server languages (Python, ASP.net ...)? – HB87 Mar 29 '17 at 14:41
  • i hope you understand, you must learn again about **server inside scripting** and **client inside scripting**, if you know basic for that, You can find out clear `WHY CAN'T DO THAT`, just if you cooperation to browser creator to send bug if open your page is not problem. or (this extreme) you create your browser for that – Abdul Aziz Al Basyir Mar 30 '17 at 08:44
  • By the way, I don't know but I implemented a maneuver with a variable that takes 3 state values (page refreshed, first time load, page crashed) and session variables. In combination with code linked in question. I know how to program I am not newbie man. Probably no body understood what I want in the question the browser did not crash just the page. So session variables are there. Simply people are lazy to figure out indirect solution. If the browser don't crash my solution works. Anyways thanks for the help. – HB87 Mar 30 '17 at 08:51
  • There are other methods I was expecting to see like implementing some sort of heartbeat mechanism etc. I am aware of all previous answers on stack overflow concerning this matter. I am aware of A lot of people especially young ones trying to get reputation points without thinking more on the question. The whole server side client side is not the only cause the main limitation is the protocol http which is stateless which these language are implementing . JavaScript is both client and server side scripting language. I should mention I worked on http2 and quic protocols. So I know this friend – HB87 Mar 30 '17 at 09:27
  • maybe i thing you must make javascript to aks question about "close this tab" and in client side server, each 3 second client send online status. if want to close tab, browser must ask question to use "want to close?". after that you know user close tab and no have crash, after that again, you checking in your php, user logout status, if user logout status from that QUESTION INSTUCTION , then this browser is not crash, else that browser have some crash.., because user not logout manualy by question, the point is if user close tab / logout,user must get question and some function. – Abdul Aziz Al Basyir Mar 31 '17 at 04:02