Questions and answers from the newsgroups 2006 11 10

Return to mozilla-dev-extensions


(↑ top)

Is there a simple POP3 or IMAP Mail notifier for FireFox 2?

I don't know if its working with multiple accounts, but heres a good notifier named "Get Mail" for Firefox < 2.0 ! Direct Installationurl : (German Version) More informations: maybe u can use the "Google Mail Notifier"? Download here Works with Firefox 1.0 - 3.0a1

I have created a Firefox sidebar extension that display correctly, but I can't get my JavaScript to reference the objects in it to make updates to the content. How can I do this?

My first thought is that you are getting the current page document but the sidebar is not the current document so you will get back a null object. You need to reference the document object of your sidebar page otherwise your ID in your sidebar will not be found. Two separate documents. You are referencing the current page document but not the sidebar's.

I need to get the URL from a tab I added. How do I do that?

var myBrowser = getBrowser().getBrowserForTab(myTab);

var myURL = myBrowser.currentURI.spec;

I need to listen for whenever a single bookmark is clicked. Which event would I listen for, and where would I put the event listener, if I wanted to capture every bookmark load?

Look through the DOM using the Inspector. Find the id for the menupopup of the bookmarks. Add a click event to the bookmarks menupopup. You could then evaluate the target of the event that occurs to determine the url of the bookmark clicked. Do a search for target event xul.

I am having some issues with an extension I am writing; I am unable to use the < (less than) sign in scripts as it gives me an error message. Why is that?

I suspect this script is in a XUL file. There are 3 ways (perhaps more) to fix this:

1. Leave the script code in the XUL file but escape XML entities appropriately; e.g., < should be < > should be > & should be & " should be " etc. (see for list)

2. Move the script code into a js file. Include that file in the XUL like so:

<script src="myjs.js"/>

3. Leave the script code in the XUL file but enclose the script code in a CDATA section; i.e.:

<script><![CDATA[// my code]]></script> 
Anyone know if I can use an animated GIF as the value of the src property on a StatusBarPanel?
var statusBarPanel = document.getElementById("my-statusbarpanel");
statusBarPanel.setAttribute("src", "myAnimatedGIF.gif");

and yes, it will animate.


(↑ top)

Document Tags and Contributors

Contributors to this page: Ptak82, MmyR2z, RichardChu, Mckwan
Last updated by: Ptak82,