mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-08 20:54:49 +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,9 +81,16 @@
|
|||||||
if (interval > 0){
|
if (interval > 0){
|
||||||
var timeout = settings.lastPersistentRndClearing + interval - Date.now();
|
var timeout = settings.lastPersistentRndClearing + interval - Date.now();
|
||||||
logging.message("registering persistent rng data clearing timeout. Clearing in ", timeout, "ms");
|
logging.message("registering persistent rng data clearing timeout. Clearing in ", timeout, "ms");
|
||||||
|
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);
|
clearTimeout = window.setTimeout(clear, timeout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function broadcast(data){
|
function broadcast(data){
|
||||||
browser.tabs.query({}).then(function(tabs){
|
browser.tabs.query({}).then(function(tabs){
|
||||||
tabs.forEach(function(tab){
|
tabs.forEach(function(tab){
|
||||||
|
@ -8,6 +8,7 @@ Version 0.4.5:
|
|||||||
- Added sections in options
|
- Added sections in options
|
||||||
|
|
||||||
fixes:
|
fixes:
|
||||||
|
- long clearing periods did not work
|
||||||
- prevent possible double faking
|
- prevent possible double faking
|
||||||
- asking did not work in some cases (auto deny)
|
- asking did not work in some cases (auto deny)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user