Changes

Jump to: navigation, search

Education/Learning/ModifyBrowser

11 bytes removed, 16:34, 19 February 2009
Second Attempt
Clearly this code has some problems, since we've completely broken addTab. Let's look for clues in the '''Error Console''' (Tools > Error Console). Notice the following exception appear whenever we try to add a new tab:
<code> Error: uncaught exception: [Exception... "Could not convert JavaScript argument" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: chrome://global/content/bindings/tabbrowser.xml :: addTab :: line 1161" data: no]</code>
Now we know how to find errors our JavaScript produces. Looking back at our code, it's clear that that '''childNodes.length''' is not zero, but 1 by default (i.e., there is always at least one tab, even if it isn't visible). A quick modification to the code, and we get:
Confirm
656
edits

Navigation menu