Changes

Jump to: navigation, search

Dive into Mozilla Modifying Firefox Lab

171 bytes added, 12:48, 16 March 2007
Success, and some bugs
==Search 1 - finding a UI string==
We're looking for a unique string--"New Tab"==, --so we'll use [http://lxr.mozilla.org LXR's] '''Text Search''' feature. Here are the results you get when you search for "New Tab":
<blockquote>http://lxr.mozilla.org/seamonkey/search?string=New+Tab</blockquote>
then run the browser to test (NOTE: ''minefield'' is my testing profile):
$ export XPCOM_DEBUG_BREAK=warn
$ ../../dist/bin/firefox.exe -p minefield --no-remote
}
==Success, and some bugs==
After repackaging the toolkit.jar file and running the browser, I'm able to confirm that this last change has been successful. Opening a new tab now works in the way I originally described. I make a few more tests to insure that I haven't broken anything else, for example, what happens if I am on the last tab and not in the middle. This works, which makes me realize that using '''append()''' is probably not necessary at all, and I can safely shorten my code down to the following:
// wire up a progress listener for the new browser object.
var position = '''this.mTabContainer.childNodes.length-1;'''
var tabListener = this.mTabProgressListener(t, b, blank);
...
t._tPos = position;
This will break tab deletion, among other things, since the positions of newly created tabs will be wrong internally. Where the assumption before was that the newly created tab was at the end of the list, the new code breaks that. Therefore, we also need to update the value of '''position'''
// wire up a progress listener for the new browser object.

Navigation menu