Saturday, October 20, 2007

Session 13 - the new tab lab

Now, I work at my brother's Windows XP computer and everything works fine!!

I'm trying the Dave's new tab solution,(the solution is not updated but it is illustrative), I had few looks here and there since I already tried this lab last week, I knew what to do but after this humongous number of hours in front of the computer doing Mozilla development labs, I am feeling pretty tired (I started at 11am and is 11pm)

Let's get started:

  • open the file: /c/ff/mozilla/browser/base/content/tabbrowser.xml
  • I've commented the following line and I added the rest:
    // Insert tab after current tab, not at end.
    var currentTabIndex = this.mTabContainer.selectedIndex;
    this.mTabContainer.insertBefore(t, this.mTabContainer.childNodes.item(currentTabIndex + 1));
    //pay attention it is a whole tab (the next after the current one) what it gets added as the second parameter
  • I've also modified this:
    // wire up a progress listener for the new browser object.
    // var position = this.mTabContainer.childNodes.length-1;
    // the tab has been added beside the currentTab rather than the end
    var position = currentTabIndex + 1;
    var tabListener = this.mTabProgressListener(t, b, blank);
  • I did a make in the objdir parallel folder: (I chose one folder above)
    $> make /c/ff/ff-debug-/browser/base
  • Then I run minefield:
    $> /c/ff/ff-debug-/dist/bin/firefox.exe -no-remote -P development
  • and it works (well, the deletion of the tabs is kind of screwed up but no energy to think why)

Create the patch - here's the patch
  • I did it from browser/base/content - Dave's going to kick my butt
    cvs diff -u8p . > tabPatch.txt
  • Save the file into the mozilla source folder and type this:
    patch browser/base/content/tabbrowser.xml <>
  • The patch will get applied and that's it!!!

No comments:

Post a Comment