Detecting when Firefox is showing a Server not found message - firefox

I'm using Firefox for a digital signage application, and there a couple of scenarios where a Server not found might result.
Network outage on boot
DNS fails to resolve for the homepage
Server (its homepage) fails to respond
Boots and the network just isn't ready by the time Firefox is loaded
Browser crashes, process is restarted, but the network is down
In such cases I would like to detect this state and simply kill and restart the process after a minute. Any other tweaks or suggestions, I'm all ears.
You do not need to consider the case whereby the loaded Web application loses Internet connectivity. That scenario I think has been handled by the Web app itself, once it has loaded.
I don't want to go down the local httpd or local extension/addon route.
Thank you in advance,

I've discovered a simple solution of overriding Firefox netError.xhtml to do a simple location.reload every ten seconds.
Source code can be found from https://github.com/Webconverger/iceweasel-webconverger/blob/master/content/netError.xhtml#L410

Related

Can I serve a wpad.dat file that tells the requesting system that there are no proxy settings?

I run a company webserver that seems to get hit constantly with wpad.dat requests. It fills up my error logs with 404 not found errors. I had considered ignoring the wpad.dat requests in the config, but upon further inspection it seems that some systems try to get this file every couple seconds at times. Some try several times a minute ongoing for days.
Can I create a wpad.dat file that I can serve to these systems to tell them there are no proxy settings so they can stop hammering the server with requests? I know the idea of the wpad.dat file is to provide auto-detected proxy settings. We only seem to have this issue with users logged into our VPN. Their web browsers just sit there and hammer the server with requests. I'd like to give them what they want. Any suggestions?
Serving this file seems to tell the connected system that there is no proxy info and to connect directly.
function FindProxyForURL(url, host) {
return "DIRECT";
}

How make auto responder for specific requests

I need in autoresponder. I develop flash application and I need substitution flash file from server to my local debug flash.
I used Charles Proxy but in last week it became badly: internet connection very slow, some responses can't wait for request.
Is there a same solution for this micro task? May be little extension for browser? Or can anybody create this extension for chrome or safari?
Or Do you know why my Charles works slowly?

Disconnecting a browser tab (testing what happens when the user connection breaks)

I'm looking for a way to force a connection break (a way to disconnect) a browser tab.
What I'm trying to do is to test my site, where I open a websocket to the server from the browser, and then emulate a disconnection, but just on that browser tab (or even just on the browser), because I need my connection to check what happens on the server in that precise instant.
I was looking for a chrome extension to do so, but I don't find any. But any way to accomplish that would be fine.
My client OS is MacOSX 10.5
In Chrome, use Menu | Tools | Task Manager to see a list of tabs. You can kill a tab in the middle of a page load from there.
You could just kill the browser process. In that case the browser wouldn't be able to close the connection gracefully. It would pretty much look like a severed network connection to the server.
See this question on superuser.com for how to kill a process on MacOS.
An even more realistic test would be to set up a virtual machine, run the client there (or the server), and then interrupt the virtual network connection.
Another option would be to set up a local proxy server (note that few proxy servers already support WebSockets), connect to the server through this proxy, and then simulate an interrupted connection by killing the proxy. That way you could observer both the servers and the clients reaction to the event.
In chrome now there's an "offline" option, under the Network tab from the DevTools, but if you are looking for a websocket disconnection, like myself, you must be aware of this:
https://bugs.chromium.org/p/chromium/issues/detail?id=423246

How To detect browser closing through asp.net web services

I have a application where I am doing recording through a third party device.Recording is started and stopped through a asp.net web service which uses the api of the recording device to start and stop the recording..
I am able to start and stop the recording through ajax in normal cases and the functiaanilty works fine in all browsers..
But,once accidently one user without stopping the video,closed the browser in which case the recording could not be stopped..and it went on recording...
So,please suggest me a way so that I can detect the time or anything that tells me when the browser is closed and then I can pass the off request to stop the recording..!!
I have read about WEB SOCKETS but they say this class is to be used in VS2012..So,I have not found any compatible solutions yet..

NSNetServices persists after stop method call?

I am doing a simple bonjour broadcast using NSNetServices. Everything is working great when I start and stop the bonjour sharing at application launch/quit. However if I turn off bonjour using the stop method call, my app still appears to be broadcasting a dead service even after the netServiceDidStop: delegate message gets called, which prevents restarting of the service until after a relaunch of the app. Apple's documentation makes it look very straightforward, just publish or stop as needed... Am I missing something?
It seems that sometimes services are shown even when they are no longer available.
From Apple documentation:
Because failing to show a valid service is a bigger problem for the user than showing a stale service, Bonjour deliberately errs on the side of assuming that a service is still available.
.
.
although Bonjour generally discovers new services within a few
seconds, if a service goes away, the disappearance of the service may
not be discovered until your app tries to connect to it and gets no
response.
You should not assume that just because the Bonjour APIs report a
discovered service, the service is guaranteed to be available when the
software tries to access it.
Connecting to and Monitoring Network Services: When resolving fails

Resources