Tuesday, March 27, 2007

Tab/Browser source for an event

0 comments
Do you want to find out what browser (tab) an event comes from? That is a tricky think to do if you have no idea (and not so easy to find). I found it in MozillaZine forum. In case it is not available or the discussion gets removed, that is the code (for Firefox 2.0):


function exampleLoadListener(event) {
var doc = event.originalTarget;
// make sure to get the top frame
doc = doc.defaultView.top.document;
var browser = gBrowser.getBrowserForDocument(doc);
var tabIndex = gBrowser.browsers.indexOf(browser);

alert(tabIndex + " - " + doc.title);
}
getBrowser().addEventListener("load", exampleLoadListener, true);


If you want to use it with Firefox 1.5, there is no getBrowserForDocument(). You must replace it with getBrowserIndexForDocument(). And, with the browser index, call gBrowser.getBrowserAtIndex() to get the browser object itself. Of course, if you want the tab itself, you can use gBrowser.tabContainer.childNodes[tabIndex].

Saturday, March 24, 2007

Italians and US Visa waiver program

0 comments
Are you Italian and not sure if you need a Visa to travel to the US? Check Italian Embassy web site in the United States. It is very confusing and the same passport type may require a visa or not depending only on its issue date. For example, I have a machine-readable passaport and fortunately was issued before Oct 26, 2005, so I don't require a visa. Anyway, it is always good to print out such a page and have it with you if you are going through US immigration soon.

And, by the way, it scares me to have a biometric passport. Its security is so weak that you can clone it while it is in its delivery envelope. Check this page to know more. If you have or need to renew your passport, be sure to be careful while holding it with you.

Telefonica site does not work properly on Firefox

0 comments
A huge company like Telefonica builds a web site that only work properly with IE. Just unbelievable. And for a state like São Paulo with over 40 million people and where the company has, I would guess, more than 90% of all landlines.

Tuesday, March 20, 2007

Openoffice and PPS?

3 comments
Do you often receive lots of PPS files and use openoffice to open them? The only difference between PPT and PPS is not the file format, but how Microsoft Powerpoint handles them. The former is opened in edit mode and the latter in slideshow mode. OO, however, does not open PPS in slideshow as it should, what is not such a big deal as it is only one click away, but why not make it easier if we can?

There is a recent extension (or package, depending on the term your distro uses) for OpenOffice named ImpressRunner. Install it and, whenever you open a PPS, it will be directly displayed in slideshow.

http://oooconv.free.fr/impressRunner/ImpressRunner-1.0.oxt

And its announce email:
http://www.mail-archive.com/dev@native-lang.openoffice.org/msg03011.html

Sunday, March 18, 2007

Hope, Faith and Love

0 comments
Nothing worth doing is completed
in one lifetime.
Therefore we must be saved by hope.

Nothing worth true or beautiful makes
complete sense
in any context of history.
Therefore we must be saved by faith.

Nothing we do, no matter how virtuous
can be accomplished alone.
Therefore we are saved by love.

- Reinhold Nibuhr