QR cooldown no longer depends on Javascript being enabled.
This commit is contained in:
parent
24f5a743f7
commit
e43db40140
@ -5,10 +5,11 @@ QR.cooldown =
|
|||||||
return unless Conf['Cooldown']
|
return unless Conf['Cooldown']
|
||||||
|
|
||||||
# Read cooldown times
|
# Read cooldown times
|
||||||
setTimers = (e) => QR.cooldown.delays = e.detail
|
scriptData = $('script:not([src])', d.head)?.textContent or ''
|
||||||
$.on window, 'cooldown:timers', setTimers
|
QR.cooldown.delays = if m = scriptData.match /\bcooldowns *= *({[^}]+})/
|
||||||
$.globalEval 'window.dispatchEvent(new CustomEvent("cooldown:timers", {detail: cooldowns}))'
|
JSON.parse m[1]
|
||||||
$.off window, 'cooldown:timers', setTimers
|
else
|
||||||
|
{thread: 0, reply: 0, image: 0, reply_intra: 0, image_intra: 0}
|
||||||
|
|
||||||
# The longest reply cooldown, for use in pruning old reply data
|
# The longest reply cooldown, for use in pruning old reply data
|
||||||
QR.cooldown.maxDelay = 0
|
QR.cooldown.maxDelay = 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user