473,387 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Browser Crash Handler

RamananKalirajan
608 512MB
Hi,
Is there any event listener or window listener for Browser Crash event other than onUnload? Is there any way to call a JS function when an application or system is crashed?

Regards
Ramanan Kalirajan
Apr 24 '09 #1
13 5351
Dormilich
8,658 Expert Mod 8TB
when a system crashes it usually doesn't execute anything until reloaded… (in FF there may be a setting available where the crash status is given so you can execute something on reload)
Apr 24 '09 #2
acoder
16,027 Expert Mod 8TB
I don't think so, though you could probably write browser-specific code to deal with a "crash" event. What kind of function would you want to run?
Apr 24 '09 #3
RamananKalirajan
608 512MB
In my application I am maintaining the user details in session. When the browser crashes the facilities must be released for that only. Previously i tried with onUnload in body it works in IE but not in Mozilla, due to Security issues they have prevented executing onunload. Then thought of using onbeforeunload listener but there are some drawbacks in using them such as, it allways prompts a confirmation msg, It is triggered even when the page is refreshed. Is there any suggestion regarding this..... Thanks in advance.

Regards
Ramanan Kalirajan
Apr 24 '09 #4
acoder
16,027 Expert Mod 8TB
Is there any reason why you want to invalidate the session? You can set a timeout of 20 minutes or half an hour.
Apr 24 '09 #5
RamananKalirajan
608 512MB
Ya I have set that thing. But I want to know wether there is any possibility to handle this condition.

Regards
Ramanan Kalirajan
Apr 25 '09 #6
acoder
16,027 Expert Mod 8TB
Not that I'm aware of, cross-browser, at least. If the browser does crash and the page is reloaded and the session continues, what's the harm?
Apr 25 '09 #7
RamananKalirajan
608 512MB
The harm is that, for each and every user will be provided with a Order ID & PON no. dynamically whenever he login to the application, those information will be stored in the DB. Without completing an order if the customer logout means we will be releasing that order id, pon and assign that to some other user. This should occur when the system crashes also. I used onBeforeUnload it was showing a prompt message even the page is refreshed and navigated to other page. In IE I used mouse click event to trace wether the user is clicking the browser close button with the PageX, PageY it was working in IE but not in mozilla due to the ClientWidth & ClientHeight are different in IE and Mozilla. I just wanted to find out wether there is any other JS function would work during the browser close event/Browser Crash. Thanks for all of ur suggestion.

Thanks & Regards
Ramanan Kalirajan
Apr 28 '09 #8
acoder
16,027 Expert Mod 8TB
I understand, but if the user immediately restarts the browser and continues the session, it's the same as staying a minute or so on one page.
Apr 28 '09 #9
RamananKalirajan
608 512MB
Yes.. That cant be done....

Regards
Ramanan Kalirajan
Apr 29 '09 #10
pronerd
392 Expert 256MB
@RamananKalirajan
This is something that needs to be done on the server side. The client side not reliable enough to carry out critical funcitons. There are too many knowns. Difffernt browser bugs, differnt browser plugins that can change behaviors, different browser security settings that can prevent JavaScript features etc. etc. This also would not handle the problem of OS level crashes, or loss of network connectivity. The server side logic needs to handle critical functions like this. Why are you assigning order numbers to people as soon as they login? That seems to be the core issue. Most systems do not assign an order number until the user places an order, and are able to avoid this problem.
Apr 29 '09 #11
RamananKalirajan
608 512MB
Thanks for your suggestion.


Regards
Ramanan Kalirajan
May 5 '09 #12
Were you ever able to figure this out?
I have the same problem now but i am not able to find any useful solution.

Thanks
Jun 8 '18 #13
gits
5,390 Expert Mod 4TB
Browser Crash:

well - it is impossible with javascript - javascript "runs on the webpage" - if the browser crashes the javascript-program crashes with it naturally. so the application has to be implemented in a way that such cases wouldn't hurt - thus it would avoid the need of a solution to solve an issue that a webpage/-application shouldnt even need to take care of.

Intentionally leave the page:

use either this:

https://developer.mozilla.org/en-US/...s/beforeunload

or this:

https://developer.mozilla.org/en-US/.../Events/unload

note that both events are not exactly the same and should be used depending on what real behaviour is to be implemented.

Option to have better information about Clientstate at the server to react there somehow

by not using normal http requests but websockets for example to communicate between server and client - its possible to receive a 'disconnect-event' at the server - which can be handled respectivly then.
Jun 11 '18 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Daniele Varrazzo | last post by:
Hi everybody, i'm experiencing crashing of the apache process when a mod_python handler access the properties "boundary" and "allowed_xmethods" of the request argument. This prevents the use of...
2
by: J Krugman | last post by:
I need guidance on implementing the following functionality in JavaScript: User clicks on a link (or button) in browser window A that brings up a separate browser popup window B featuring a...
4
by: cs | last post by:
How can I capture the events leading to my windows application crashing? would a big try catch around the Application.Run() do the job? in my head that launches a thread and if that thread crashes...
3
by: Joe Fallon | last post by:
I have a page in ASP.Net 1.1 which contains an image control. I set the ImageUrl property = "MyImageViewerPage.aspx" This page acts as an image handler. I have an array of bytes which I send to...
9
by: Droopy | last post by:
Hi, I am running an application on 74 PC (1 instance on each PC). This morning, 2 applications crashes. There were neither popup windows signaling it nor dump file created. I only find in the...
6
by: bjornms | last post by:
The application i build in C#.net is crashing once a month. I can't reproduce the crash. Is there a way to track down where the program crashes, without putting logging everywhere in the code?...
1
by: pvogel | last post by:
Hi Folks, I've got an asynchronous pluggable protocol (APP) handler implemented (based on the excellent work here: http://www.codeproject.com/aspnet/AspxProtocol.asp) that works absolutely...
5
by: Mahmoud Al-Qudsi | last post by:
I have an application that builds and runs just fine on my PC. It's pure C#, no P/Invoke, no Win requirements or anything. I built the app, stuck the dependcies in the same DIR, and copied it to...
1
by: Sendil kumar | last post by:
Hi All, I have a C++ apllication which in turn loads the jvm. When the JVM is loaded it turns off my crash handler filter and sets its own filter by default, so, when ever a crash happens I was...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.