Showing Tooltips in XUL Browser.

Keep the following code in the respective files.

.xul File

<browser id = “browser1″





flex=”1″ />

<tooltip id=”aHTMLTooltip” onpopupshowing=”return FillInHTMLTooltip(document.tooltipNode);”/>

.js File
function FillInHTMLTooltip(tipElement)

var retVal = false;
if (tipElement.namespaceURI == “;)
return retVal;

const XLinkNS = “;;

var titleText = null;
var XLinkTitleText = null;

while (!titleText && !XLinkTitleText && tipElement) {
if (tipElement.nodeType == Node.ELEMENT_NODE) {
titleText = tipElement.getAttribute(“title”);
XLinkTitleText = tipElement.getAttributeNS(XLinkNS, “title”);
tipElement = tipElement.parentNode;

var texts = [titleText, XLinkTitleText];
var tipNode = document.getElementById(“aHTMLTooltip”);

for (var i = 0; i < texts.length; ++i) {
var t = texts[i];
if (t &&\S/) >= 0) {
tipNode.setAttribute(“label”, t);
retVal = true;

return retVal;

technorati tags:, , , ,

Blogged with Flock

Posted in MOzilla. 1 Comment »

XUL Browser secret features to show up Tooltips

Secret Features

        user_pref(“”, true);


        By the secret settings above (by the “user.js” or the “about:config” feature), the browser popups all of attributes in the list. If the pointed element doesn’t have the attribute, the browser finds a parental node which has the attribute. And, the following setting shows attributes for all of parental nodes:

        user_pref(“”, true);

These features possibly prevents spoofings and phishings.

NOTE: Cited from

technorati tags:, , , ,

Blogged with Flock

Change default printer in Mac

The following statement change default printer to “hp LaserJet 1320 series (FBBF32)”.

What u have to do is replace non-alphanumeric symbols with “_”.

system(“lpoptions -d hp_LaserJet_1320_series__FBBF32_”);

Code to set our printer as default printer and reset to previous one.



// Create Session for Printing Operation.


PMPrinter printer;

PMSessionGetCurrentPrinter(printSession, &printer);

CFStringRef availablePrinterID = (CFStringRef) PMPrinterGetID(printer);


char *printerNameToLPOptions = (char *) malloc ( sizeof(char) * ( 14 + strlen(printerName)) );

strcpy(printerNameToLPOptions,”lpoptions -d “);


printerNameToLPOptions[strlen(printerNameToLPOptions)] =”;




char *aPrinterName = (char*)CFStringGetCStringPtr(availablePrinterID,kCFStringEncodingMacRoman);

char *printerNameToLPOptions = (char *) malloc( sizeof(char) * (14 + strlen(aPrinterName) ) );

strcpy(printerNameToLPOptions,”lpoptions -d “);






technorati tags:, , , ,

Blogged with Flock

XUL Browser not open popup window

To make the XUL Browser to open popup window you have to set the following priviledge in the prefs.js

( Which is in Corresponding application folder of Application Support folder ).“UniversalXPConnect UniversalBrowserWrite”);

You can program it like the following one.

var prefManager = Components.classes[“;1”]

prefManager.setCharPref(“capability.principal.codebase.p0.granted”,”UniversalXPConnect UniversalBrowserWrite”);


technorati tags:, , , , , ,

Blogged with Flock

Limit Preference window size to remove blank space below.

when browser.preferences.animateFadeIn is true the blank space is coming below the xul elements in the Preferences window.

Solution: Set height and width of the preference window.

technorati tags:, , , , , , , ,

Blogged with Flock