Revision: 3822
Author: jasvir
Date: Wed Oct 21 00:25:54 2009
Log: Edited wiki page through web user interface.
http://code.google.com/p/google-caja/source/detail?r=3822
Modified:
/wiki/Debugging.wiki
=======================================
--- /wiki/Debugging.wiki Wed Oct 21 00:17:27 2009
+++ /wiki/Debugging.wiki Wed Oct 21 00:25:54 2009
@@ -9,7 +9,8 @@
occured, the url of the offending content as well as a line number and
offset.
-For example, suppose you try to cajole the following piece of code: {{{
+For example, suppose you try to cajole the following piece of code:
+{{{
<script>
var top;
with(top) { location = "http://www.evil.com" }
@@ -52,7 +53,8 @@
runtime. On browsers that support a console, runtime errors are
logged to the console configued by the container.
-For example, suppose you try to cajole and run the following piece of
code: {{{
+For example, suppose you try to cajole and run the following piece of code:
+{{{
<script>
top.location = "http://www.evil.com";
</script>
@@ -73,7 +75,8 @@
`window`, `top` and `navigator` which you may expect to be defined
when you are running JavaScript in a browser will all be undefined.
-Here's another trivial piece of code with an error: {{{
+Here's another trivial piece of code with an error:
+{{{
<script>
function apply(func, val) {
return func(val);
@@ -106,16 +109,17 @@
Here are some tips that you may find helpful:
-* [http://www.squarefree.com/shell/shell.html SquareFree Shell] provides a
very useful [https://www.squarefree.com/bookmarklets/webdevel.html
bookmarklet] which you can load in the same frame as a cajoled
application. In the shell, you can access what a cajoled gadget perceives
its global scope to be as follows: {{{
+ * [http://www.squarefree.com/shell/shell.html Squarefree Shell] provides
a very useful [https://www.squarefree.com/bookmarklets/webdevel.html
bookmarklet] which you can load in the same frame as a cajoled
application. In the shell, you can access what a cajoled gadget perceives
its global scope to be as follows:
+{{{
var gadgetGlobal = ___.getNewModuleHandler().getImports().outers;
}}}
-* You can test if some property of an object is readable, settable or
callable by the gadget with `___.canRead(obj, property)`, `___.canSet(obj,
property)` and `___.canCall(obj, property)` respectively.
-
-* Other [InternalProperties internal properties] can also help identify
why a cajoled program behaves differently from an uncajoled one
-
-* By default, many containers will minify cajoled output for efficient
delivery. This is not ideal for debugging. If possible, request debug mode
from the container or use the testbed for debugging.
-
-* If you are using Firefox, install the Firebug extension. Caja dumps
useful logs and stack traces in the console.
-
-* If the container has made the `alert` function or the `console.log`
functions available, they provide very useful feedback.
+ * You can test if some property of an object is readable, settable or
callable by the gadget with `___.canRead(obj, property)`, `___.canSet(obj,
property)` and `___.canCall(obj, property)` respectively.
+
+ * Other [InternalProperties internal properties] can also help identify
why a cajoled program behaves differently from an uncajoled one
+
+ * By default, many containers will minify cajoled output for efficient
delivery. This is not ideal for debugging. If possible, request debug mode
from the container or use the testbed for debugging.
+
+ * If you are using Firefox, install the Firebug extension. Caja dumps
useful logs and stack traces in the console.
+
+ * If the container has made the `alert` function or the `console.log`
functions available, they provide very useful feedback.