Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '[OT] Timely, almost' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
[OT] Timely, almost
Authored by: n8gray on Jan 17, '06 03:44:49PM

This is bloody hilarious. After using FF as my main browser for the last few weeks I finally decided to figure out how to bind next/prev tab to something I like. I spent an hour with a friend digging through .xul files and searching the web, eventually finding the keyconfig extension. We hacked together some javascript and debugged until it was working. I thanked him, restarted FF, and browsed to my favorite OS X hints site. What's the first hint? This one.

I often tell my wife that the universe revolves around me, but for some reason she has doubts that this is so. This is a nice bit of evidence for my case, apart from the inconvenient temporal flaw that I didn't see the site *before* spending an hour solving the problem. Still, your javascript one-liner is much better than my 10-liner, so I can't fault the universe *too* much. After all, it can't be easy to bend all those dimensions to my convenience; I'm prepared to forgive a minor causality error every now and then.

In all seriosity, thanks for the hint!



[ Reply to This | # ]
Hey, don't blame me...
Authored by: Thom on Jan 17, '06 04:31:00PM

...I voted for Kodos! Er, wait, nevermind.

Did the version you came up with, look something like what I posted over here?

// previous tab, cycle to last one if at beginning
if(gBrowser.mCurrentTab.previousSibling)
{
gBrowser.mTabContainer.advanceSelectedTab(-1);
}
else
{
// call method to go to tab:
gBrowser.mTabContainer.selectedIndex = gBrowser.mTabContainer.childNodes.length-1;
}

I also spent a lot of time poring through the technical documentation for firefox, exploring in the DOM inspector, and so forth, and that's what I came up with. Then I posted it to the mozillazine and Dorando, the author of keyconfig, pointed out the second argument to the method. Heh.



[ Reply to This | # ]
Hey, don't blame me...
Authored by: n8gray on Jan 18, '06 02:11:30PM
Did the version you came up with, look something like what I posted over here?

No, it was much worse. I wish I still had it around so I could post it for your amusement. I didn't know about the advanceSelectedTab method so I was first manually walking the array of tabs to find one that was == to the current tab, then changing focus to tab (i+1)%length. I don't know jack about javascript or Firefox, so I was pretty happy to have made it that far!

[ Reply to This | # ]