Posts: 629
Threads: 73
Joined: 2012-08-15
Hi folks,
Am I the only one who think this is too sad to be disconnected from the blitzortung websocket when I'm not on the window of blitzortung.
It is impossible to have a dual screen with the map on one display and an other thing on the main display.
Regards
Posts: 366
Threads: 13
Joined: 2015-08-21
2016-03-06, 00:03
(This post was last modified: 2016-03-06, 00:57 by kevinmcc.
Edit Reason: Better answer.
)
(2016-03-05, 17:38)DelandeC Wrote: Hi folks,
Am I the only one who think this is too sad to be disconnected from the blitzortung websocket when I'm not on the window of blitzortung.
It is impossible to have a dual screen with the map on one display and an other thing on the main display.
Regards
You can fix this with Greasemonkey.
I am sure they put the code the to reduce bandwidth taken up by hidden tabs and minimized windows.
I am not sure how the devs will feel about people doing this, but the script is below.
Code:
// ==UserScript==
// @name Blitzortung Map Always Update
// @namespace http://en.blitzortung.org/
// @description Makes onblur set isFocus true or loadstrikes.
// @include http://en.blitzortung.org/live_dynamic_maps.php
// @version 1
// @grant none
// ==/UserScript==
window.onfocus= function() {
if (!(isFocused)) {
isFocused = true;
if ((!(ws === undefined))&&(ws.readyState == 1)) {
ws.send('{}');
}
else {
loadStrikes(map,true,false);
}
}
};
window.onblur= function() {
if (!(isFocused)) {
isFocused = true;
if ((!(ws === undefined))&&(ws.readyState == 1)) {
ws.send('{}');
}
else {
loadStrikes(map,true,false);
}
}
};
Posts: 899
Threads: 55
Joined: 2012-06-26
2016-03-06, 09:14
(This post was last modified: 2016-03-06, 09:14 by Egon.)
Hi,
yes, the main problem is the huge data traffic. Up to June, this is not a big problem but if we have thunderstorms, then several thousands people start looking where it is, change the window, and do anything else. But the browser still continiously loads data. It is not only the huge data traffic but also the large number of open connections.
At the beginning, we have broken the connection every hour, but the current solution is much more effective.
Egon
Posts: 629
Threads: 73
Joined: 2012-08-15
OK.
What about not disconnecting logged in users (participants)?
Posts: 899
Threads: 55
Joined: 2012-06-26
You can switch it of by adding "?connect_onfocus=0" to the url. It is stored in a cookie. Look also what happens if a browser tab with a real-time map is closed, and opend one hour later.