QUOTE(gianfrix94 @ Jan 29 2017, 23:19)
I'll go fix everywhere this error is soon.
On chrome this error doesn't appear so i never noticed it, sorry.
EDIT: With the else on Chrome it doesn't work on the first turn, so i'm keeping it like it is now.
That's because of the userscript execution order.
- In case of execution order is HV_Cooldown -> Reloader.
HV_Cooldown: addEventListener('Reloader_reloaded', HV_Cooldown)
run HV_Cooldown()
Reloader: dispatch event Reloader_reloaded then triggered HV_Cooldown()
- In case of execution order is Reloader -> HV_Cooldown.
Reloader: dispatch event Reloader_reloaded, but event HV_Cooldown() does not yet exist.
HV_Cooldown: addEventListener('Reloader_reloaded', HV_Cooldown)
HV_Cooldown: run HV_Cooldown()
And about Chrome.
If you use tampermonkey, it will more happen.
And with or without tampermonkey it will more happen latest chrome than older chrome.
To avoid this issue, change to @run-at document-start with DOMContentLoaded and then use addEventListener or MutationObserver (like tatarime's scripts).
This issue only happen at begin of round (at page load).
If script is work at end of round like counter plus or script does not matter multiple runs at begin of round, no problem.
This post has been edited by NerfThis: Jan 30 2017, 05:14