This seems to be a problem with Waterfox Classic’s JavaScript engine. I adjusted the code and it should work now. (At least it does on my machine.)