There's also caja (http://code.google.com/p/google-caja/) which goes about solving the problem in a slightly different way