Friday, 16 August 2013

How do I access (r/w) the Firefox Boomark Toolbar items using JavaScript?

How do I access (r/w) the Firefox Boomark Toolbar items using JavaScript?

I want to access the Firefox Bookmark Toolbar items using standard
JavaScript.
I need to read the Name, and would like to be able to set it, too, if
possible.
I can access the Bookmark Toolbar items using CSS in the userChrome.css
file, like:
.bookmark-item[label="showLinkedImagesRegex"] image {
width: 0 !important;
height: 0 !important;
padding: 0 0 16px 16px !important;
background-image: url("file:///C:/fficons/rainbowbox16.png");
}
The "Name" is also the "label", which is the text displayed for the
Bookmark. (and in userChrome.css as above it is used as a "selector" to
assign CSS style rules)
So I guess I need to somehow access the bookmark-item's using DOM or
something?
Via chrome::?
Somehow be able to iterate through them.
I don't want to have to create a Firefox add-on extension to do this.
This is a work-around project for the now-broken and not-to-be-fixed
Bookmark Favicon Changer extension.
I'm trying to make an HTML 5 editor-helper program for the userChrome.css
entries needed to add an icon image to Bookmark Toolbar entries. (so you
don't have to do it manually using a text editor) Ideally I want to read
the Bookmark Toolbar entries, parse out what is in userChrome.css, and
make a fairly simple "editor" that would allow selection of icons for each
entry and then create/modify the needed CSS in userChrome.css. I would
also like to be able to change the Name/label value, as well, rather than
having to do that using Firefox. (manual right-click menu Properties
editing)

No comments:

Post a Comment