mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 12:50:36 +01:00
Split long clear timeout delays.
window.setTimeout can not handle big delays. Fixes #180
This commit is contained in:
parent
10d9c022e0
commit
6f8f9a7e9c
@ -81,7 +81,14 @@
|
||||
if (interval > 0){
|
||||
var timeout = settings.lastPersistentRndClearing + interval - Date.now();
|
||||
logging.message("registering persistent rng data clearing timeout. Clearing in ", timeout, "ms");
|
||||
clearTimeout = window.setTimeout(clear, timeout);
|
||||
if (timeout > 1073741824){
|
||||
// window.setTimeout can only handle delays up to 32 bit.
|
||||
// Therefore we repeat the registering afert 2^30 = 1073741824 seconds
|
||||
clearTimeout = window.setTimeout(registerTimeout, 1073741824);
|
||||
}
|
||||
else {
|
||||
clearTimeout = window.setTimeout(clear, timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
function broadcast(data){
|
||||
|
@ -8,6 +8,7 @@ Version 0.4.5:
|
||||
- Added sections in options
|
||||
|
||||
fixes:
|
||||
- long clearing periods did not work
|
||||
- prevent possible double faking
|
||||
- asking did not work in some cases (auto deny)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user