Hello,

Just as a test, I'm trying to add a bookmark through a simple
extension.
Here is the code, with the XPCOM stuff mostly taken right from the
XulPlanet tutorial.

-------
function addbm(event)
{
    var bms;

    bms = Components.classes["@mozilla.org/browser/bookmarks-service;1"]
                    .getService(Components.interfaces.nsIBookmarksService);
    bms.addBookmarkImmediately("http://mozilla.org";,
                                      "keeptabs",0,"text/html");
        /*alert("inside addbm")*/
}
window.addEventListener("load", addbm, false);
-------

I put it in an extension, so that it should create that same bookmark
everytime I start up Firefox... But it doesn't work! I put an alert in
the function just so I can be sure that the extension is working. And
it is, the alert comes up whenever I load Firefox. But no bookmark
appears in my bookmarks. I'm stumped.

Can anyone see what it is I might be doing wrong?

Thanks,
-Marc
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to