Hi all, I'm getting started with caja, and I've read through the wiki and searched this group, but I'm still a little unclear on a couple concepts. I'd appreciate any guidance you all can offer.
I'm looking to use caja to allow users to safely run 3rd party javascript code that defines logic for a simple game. This 3rd party code should be totally partitioned from the dom, except via the javascript libraries I provide (which will mostly be drawing on a canvas and handling dom events). It seems like this is in fact a far simpler use case than the target caja applications (right?). I've read through the wiki, and I've figured out the cajoling process using the command line tool. But when it comes to actually writing a container to use the cajoled code with my library, I have a few questions: 1. What is the expected usage pattern for a developer incorporating caja? Here's my guess: - Build a cajoling process that takes arbitrary javascript code and turns it cajoled code. - Write container code that loads the cajoled code. - Tame all shared libraries used by cajoled code. 2. Since I don't want the 3rd party code to have access to the DOM, can I just remove most of the initValija logic except the adding of extraOuters shared state? 3. How should I go about taming my library? Can I simply use the InnocentCodeRewriter? If so, how do I use this? 4. What is the .vo.js suffix used in the sample code script elements (http://code.google.com/p/google-caja/wiki/CajaHostingModules)? Thanks, Brent
