Closed climatebrad closed 3 years ago
Makes sense, not something I would try to detect or fix. The solution is not run it twice, IMO. I mean I could add a check, but it be very very low on the list of things to add.
Paging @Aktanusa as this is something that he needs to decide on as well.
After reading up on javascript 'kill'-functions it seems to me that the only solution would be to wrap every src/
document in a Main()
function. For example, MainCMDisp()
and MainCMMain()
. That way we can stop any execution of the code if a variable (say CM.isRunning
) is defined. This might also make implementation of #32 possible.
The current problem is that we can't stop execution of line 5 of the Header CM = {};
, which breaks everything
However, as this touches the core design of the code I do not want to make a decision on my own. So, @Aktanusa, @bitsandbytes1708 and any others please chime in!
This has been implemented with #393
I'm a bit late, lol. I mean honestly this is a silly thing for someone to do and can be easily fixed by not running it twice. But then again, the implementation was very simple, so oh well. It works, it works. Thanks for bringing this to my attention.
Yeah I have implemented another fix which was much easier. However, #32 might be more difficult to implement.
If Cookie Monster is already active, choosing the bookmarklet again causes Cookie Clicker to freeze. (Chrome)
to replicate: start Cookie Clicker run the Cookie Monster bookmarklet run the Cookie Monster bookmarklet again