Return to mozilla-dev-tech-xul summaries
The frequently asked questions should be moved to XUL FAQ (make sure they have a clear answer.)
Creating MozSearch plugins contains more help information about creating MozSearch plugin on Firefox 2. More documentation on Search plugins is available in the Search plugins category.
When an element is removed from the DOM or simply moved around, all attached event listeners are lost. Event listeners must be added again if needed. This is bug 286619 , fixed for Gecko 1.9.
Loading remote DTDs for XML documents is currenty not supported in XUL. The following bugs were reported on this issue: bug 22942 , bug 133698 .
Daniel Glazman has been working on this for his projects. He said the code will be open-source, but it is not released yet (as of Oct 2006). Some teasers are on his blog.
The original developers only tend to put IDs where they need them. As an extension author, you have at least two options:
There are several options for displaying graphics and animation in XUL:
Support for non-RDF datasources for XUL template is planned ( bug 321170 ):
That error is from a security check that has been put up to safeguard against cross-site-scripting attacks.
A scheme is in development to allow servers to open up their site for cross-site access, but that's not yet done.
Unfortunately, no simple solution to this was posted. A workaround is to open the content in a new window using "window.open" and send titlebar=”no” as one of the flags in the 3rd argument.
The current issue is a person exploring if it is possible to have checkbox support for multi column lists. The following is the code they wrote:
List box handlers can only check for listitems not listcells. If user wants checkbox support for multicolumn lists, then they will have to implement one.
XUL attributes such as left="100" or top="200", as well as corresponding properties, look as if they're integers but they are actually handled as strings. To convert them to integers use the parseInt() JavaScript function.
While the attributes are always strings per the DOM specification, the properties will eventually be fixed to return the value with the correct type.
From XULPlanet.com reference:
There may be a few ways to implement this:
To set the background color you need to set the property for the cell/row and not for the item. An example of this is:
Using the following code sample,
The person can get the titles too using the .contentTitle tag.
<prefwindow> can contain any control, just like a regular window. Some of them can be tied to a preference so that the preference is automatically updated as the control is manipulated. Others, like <listbox>, cannot be so tied, but one can always write a script that updates preferences explicitly, via nsIPrefBranch interface.
You should be able to use a XUL template to display feeds, although you may have to write the feed data to an RDF datasource first.
To specify a function to run when the window is loaded,add the following code between the script tags in the XUL file:
Similarly, for onunload use the code:
An event is initiated when the application starts up and when the profile is changed. For more information please look at the following link: nsExtensionManager.js
Python has full support for variants. Pass a Python string/int/etc to the method requiring an nsIVariant. A Python object is convered when implmenting an interface taking an nsIVariant.
If you have a similar code base as the following:
Use the hidePopup() function to solve this issue.
An example of this is this:
Use the following snippet of code to add a new element under an existing element:
var elem = document.getElementById(XUL_ELEMENT_ID); var node = document.createElement(XUL_ELEMENT_NAME); node.setAttribute(ATTRIBUTE, VALUE); node.setAttribute(ATTRIBUTE, VALUE); elem.appendChild(node);
The sidebar's content is a separate document, so you should use document.getElementById("sidebar").contentDocument.getElementById(...)
This is something you could see using the DOMi.
See also http://developer.mozilla.org/en/docs...in_chrome_code
Use the following snippet of code to reference a js file within a js file:
objScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader); objScriptLoader.loadSubScript(strURL);
See http://www.xulplanet.com/references/...iptLoader.html for more information.
var settings = PrintUtils.getPrintSettings();
var settings = PrintUtils.getPrintSettings().clone();
Mailing lists are children of directories. As such, you cannot use a template to display them in the same list. The best you can do is a cascading menu along the lines of the move/copy menus, but then of course you lose the ability to easily select from the list.
Instead of
It should be written as follows:
With Mozilla trunk
These don't really belong on this page.
Visit http://developer.mozilla.org/en/docs...pplication.ini to find out how to properly set up the application.ini file.
Page last modified 22:31, 28 Jun 2008 by Minh Nguyen