Does anyone want to explain how this works? I had no idea dragging onto a tab could start up javascript on a page. It's amazing!
Asteroids JavaScript Bookmarklet to blow up any web site
41–50 of 77 posts
What you're talking about has been around forever, and is called a "bookmarklet"
Re: Asteroids JavaScript Bookmarklet to blow up any web site
#42Fun, and it doubles as an easy way to spot table layouts.
Re: Asteroids JavaScript Bookmarklet to blow up any web site
#43this wins 2010's most innovative app ever
Re: Asteroids JavaScript Bookmarklet to blow up any web site
#44Hm, thinking about writing defence script to my sites and start js-war.
Surround important elements with DOM shielding...
Re: Asteroids JavaScript Bookmarklet to blow up any web site
#45Someone should add touch events so it works on iPad / iPhone.
Re: Asteroids JavaScript Bookmarklet to blow up any web site
#46It's oddly non-deterministic. Add two ships and fly around a bit. They're paths will quickly diverge.
It's not that it's non-deterministic, it's just that, since your javascript interpreter doesn't execute each instance and its event handlers in parallel, each instance will receive slightly different inputs. This is because the number of times each instance's main loop fires before its keyup/down handler gets called will vary.
If you load up, say, 6 instances, hold the up button for a while to get them up to full speed, then turn for 4 or 5 seconds and let go, they'll be a bit divergent, but not too badly. They should all be going roughly the same direction, and wrapping around at roughly the same time.
If you load up 6 instances again, hold the up button for a while, and then turn back and forth very rapidly for a short period of time, they'll be much more divergent.
Re: Asteroids JavaScript Bookmarklet to blow up any web site
#47Re: Asteroids JavaScript Bookmarklet to blow up any web site
#48[deleted]
Re: Asteroids JavaScript Bookmarklet to blow up any web site
#49Re: Asteroids JavaScript Bookmarklet to blow up any web site
#50Fun, and it doubles as an easy way to spot table layouts.
Spot....and kill them