Vincent Lam’s Weblog

On Open Source

Modifying the Browser Lab (continued! done)

I restarted my adventure on this yesterday with Rueen and Vijey, and we got this to work. I will post my patch to my wiki shortly.

i had a problem with this lab. my codes are not being pick up when I complie. I have been trying to add “printf”. so that i can pin point the line that i would like to edit, but it does not work at all. I do not understand why… ? I have a few mozilla build (c:/ff/; c:/mozilla) I am sure I was editing and building the correct one but it just doesn’t work (tried with ff and mozilla). This is strange…and I ran out of idea… that’s why this lab took me a few days…

my solution to this is to rebuild it to a new directory (yes… i have 3 build now) at c:/ffm. finally, my changes worked.

now i have to make changes to the code. from my previous blog, i found loadOneTab and mTabContainer. From these, I found the appendchild function. I tested the code by copying appendchild function and repeated that a few times… I tested it with “Ctrl + T”, and a few new tab pop up. Nice.

I started my research on appendchild. I think? I should “reverse append child” or something similar.

looked up mxr (learned that from class), looked up “” (Armen was doing that last Thursday, so I figure I should give that a try) and yes, i find a bunch of functions:

Inherited from XUL element
blur, click, doCommand, focus, getElementsByAttribute

Inherited from DOM element
addEventListener, appendChild, dispatchEvent, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeEventListener, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS

at first, appendChild, HasChildNode, removeChild and ReplaceChild catch my attention, but insertBefore just pop my eye out (Moreover, I hear Cathy & Dave & Michael was talking about that in class on Thursday, so… it makes sense.). they has an example on how to “insert” stuff before “another” too, basically follow that and make change accordingly. 🙂

replace appendchild, figure out what to put inside insertbefore, update the counter/index/etc. relax a little then just build is done.


October 17, 2007 - Posted by | open source

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: