Skip to content
Files related to the effort to cajole YUI
JavaScript PHP Shell
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



This projects contains files related to the effort to cajole YUI.

  • YUI: The YUI Library is a set of utilities and controls, written in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX.
  • Caja: A source-to-source translator for securing Javascript-based web content

This project requires the full source tree for YUI2 and Caja, both publically available.

Quick start:

[~] ➔ mkdir src; cd src
[~/src] ➔ svn checkout google-caja
[~/src] ➔ git clone git://
[~/src] ➔ git clone git://
[~/src] ➔ cd google-caja
[~/src/google-caja] ➔ ant testbed
[~/src/google-caja] ➔ cd ../yui-caja
[~/src/yui-caja] ➔ ln -s ../yui2 tests/css
[~/src/yui-caja] ➔ ln -s ../yui2 tests/yuitests/css
[~/src/yui-caja] ➔ ln -s ../yui2 tests/examples/css
[~/src/yui-caja] ➔ ant
[~/src/yui-caja] ➔ open tests/host.php?test=dom (open with a web browser, this may need to be served through a local web server)

In addition to some adhoc tests, we are in the process of converting the YUI test suite and many examples from the 2.7.0 release to run under Caja. The adhoc tests are located in the tests directory, the yuitests in the tests/yuitests directory, and the examples in tests/examples.

A modified version of YUI Test is included in the distribution to run the tests included in the yuitests directory. Test output is directed to the browser’s console. Use FireBug in Firefox, Web Inspector in Safari/WebKit, Dragonfly in Opera, and FireBug Lite in IE to see the results. FireBug Lite is automatically loaded to the page in IE.

The tests directory contains an index.php file that includes a summary of the current status of the Cajoling effort, displayed in three DataTables. All cajoled tests and examples are linked from the corresponding module entry or its notes.

All tests and examples use a single host.php file to make it possible to run all of the tests and examples from the single host file. This page takes a few parameters to indicate which test or example you wish to run. The only required parameter is ‘test’:

By default, the hosts file looks for yuitests for the named test

The adhoc tests are called gadgets and require the suffix param as well

The examples require the ‘example’ suffix and the inclusion of any libs not in the utilities rollup via the include param

If you don’t have a php enabled web server available, it would be simple to create a static html file for the test you wish to run from the php file.


  • Replace the script execs with the cajole task should it exist, or create one.
  • Host file build step that generates the correct urls to the caja environment based on the caja.base property.
  • Document capabilities and known issues for each component. (in progress see /tests/index.php)
Something went wrong with that request. Please try again.