Gernot Frisch wrote:
What would keep you from starting a disk maintenence program and
deleting the entire disk?
That brings up another question: What's the worst thing you can do in
JavaScript?
On a web browser, make anything important depend on its successful
execution.
Unless you meant: What is the most directly harmful/destructive thing
you can do with javascript? Insofar as the above doesn't already cover
that; there are security holes in some browsers that do allow scripts to
do nasty things to the user's computer (mostly exploiting ActiveX), but
they get patched. Crashing (or locking up) the browser isn't a very nice
thing to do (almost all browsers can be deliberately crashed by a script
one way or another), and consuming all of the available memory will
usually bring a browser to its knees (along with the OS sometimes).
Apart form that there are no shortage of anti-social things that can be
done with scripts. How anti-social something is depends to some extent
on the user's attitude and habits but popular candidates include:-
1. Interfering with the context menu.
2. Opening pop-up windows (especially advertising, surveys and
other unwanted intrusions).
3. Attempting to close the user's existing browser window
(particularly if the attempt is successful).
4. Opening windows with restricted features (chrome).
5. Re-sizing and/or moving existing browser windows.
6. Opening full screen windows. (or attempting to position new
windows in stupid places, such as the middle of the desktop).
7. Trapping the user into some action or sequence (usually filling
in forms) by re-focusing HTML elements/window whenever the user
attempts to do something else (which is more important to the
user at the time, else they wouldn't want to do it).
8. Modifying browser/control behaviour, keyboard shortcuts, etc,
so that interactions do not produce the normal (expected) results.
Richard.