MozillaZine

Extension to Replace Generic Folder Icons with Favicons

Talk about add-ons and extension development.
lilygotsilly
 
Posts: 121
Joined: April 11th, 2005, 8:24 pm

Post Posted December 9th, 2005, 12:57 pm

Lee_Dailey wrote:you are not the only person who wants control of those icons. well, that's obvious from the fact that the code you were apparently using is mentioned in lots of other threads. [*grin*] what i meant to say is that since it is not a totally off the wall desire, perhaps it would be useful to go to the extensions forum ans ask if someone has made - or would make - an extension to hanldle that for ya auto-magically.

- extensions forum
http://forums.mozillazine.org/viewforum.php?f=19

it sounds like an interesting focus for an extension ... to me at least. [*grin*]


I'm taking your advice, Mr. Dailey.

Basically, I have used chromedit to replace my bookmarks toolbar folder's generic folder icons with my favorite favicons(w/o labels).

Now I'm trying to do the same to all my folder icons in the drop menus. I've tried code for this too , but ran into a lot of problems that even effected my toolbar favs -- so I finally deleted all the drop menu codes and accepted the fact that I can only change the toolbar folders at the moment.

Anyone want to develop an extension for replacing ALL generic folder icons with favicons of the user's choice? :)

lilygotsilly
 
Posts: 121
Joined: April 11th, 2005, 8:24 pm

Post Posted December 9th, 2005, 10:09 pm

No takers??

RaiseMachine

User avatar
 
Posts: 1764
Joined: December 6th, 2004, 6:05 pm
Location: England

Post Posted December 10th, 2005, 1:01 am

No extension needed...
Place this in your userChrome.css file in your Profile chrome folder
Code: Select all
.bookmark-item {
  list-style-image: url('file://F:/Mozilla.org/Firefox-Pacifica/chrome/icons/default/URL.ico') !important;
  -moz-image-region: rect(0px 16px 16px 0px) !important;
}
.bookmark-item[container="true"] {
  list-style-image: url('file://F:/Mozilla.org/Firefox-Pacifica/chrome/icons/default/Folder.ico') !important;
  -moz-image-region: rect(0px 16px 16px 0px) !important;
}

Replace the file paths and image file names accordingly. Image files can be .ico, .jpg, .png.
"Doesn't the idea of making nature against the law seem to you a bit... unnatural ?" - Bill Hicks
"Money is the Schrodinger's Cat of economics." - Robert Anton Wilson
"It's not a bug, it's two features having a fight in the pub car-park." - Me

swordfisher
 
Posts: 4
Joined: December 1st, 2005, 9:00 pm
Location: Clinton Township, MI

Post Posted December 10th, 2005, 10:31 am

RaiseMachine wrote:No extension needed...
Place this in your userChrome.css file in your Profile chrome folder
Code: Select all
.bookmark-item {
  list-style-image: url('file://F:/Mozilla.org/Firefox-Pacifica/chrome/icons/default/URL.ico') !important;
  -moz-image-region: rect(0px 16px 16px 0px) !important;
}
.bookmark-item[container="true"] {
  list-style-image: url('file://F:/Mozilla.org/Firefox-Pacifica/chrome/icons/default/Folder.ico') !important;
  -moz-image-region: rect(0px 16px 16px 0px) !important;
}

Replace the file paths and image file names accordingly. Image files can be .ico, .jpg, .png.


I think he may mean that he wants to replace multiple folder icons by assigning various different images to them depending on which folder it is, within his bookmarks.

RaiseMachine

User avatar
 
Posts: 1764
Joined: December 6th, 2004, 6:05 pm
Location: England

Post Posted December 10th, 2005, 2:50 pm

As far as I understand the bookmarks system atm, I'm wondering whether that would be possible.

Bookmark favicons are stored in the bookmarks.html file. The folder icons are taken from the current theme and therefore aren't stored in bookmarks.html.

See my post below for solution.
Last edited by RaiseMachine on October 2nd, 2008, 5:39 pm, edited 2 times in total.
"Doesn't the idea of making nature against the law seem to you a bit... unnatural ?" - Bill Hicks
"Money is the Schrodinger's Cat of economics." - Robert Anton Wilson
"It's not a bug, it's two features having a fight in the pub car-park." - Me

logan

User avatar
 
Posts: 3453
Joined: May 22nd, 2003, 3:51 pm
Location: NGC 2403

Post Posted December 10th, 2005, 3:00 pm

It shouldn't be a problem to override the theme's folder icon if an alternative exists in the bookmark folder's resource. See bug <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=264241">264241</a>.

RaiseMachine

User avatar
 
Posts: 1764
Joined: December 6th, 2004, 6:05 pm
Location: England

Post Posted December 10th, 2005, 3:16 pm

It's OK I've worked out how you can do this without an extension.
Code: Select all
.bookmark-item[container="true"][label="FolderName"] {
  list-style-image: url('file://F:/Windows/icons/Folder.ico') !important;
  -moz-image-region: rect(0px 16px 16px 0px) !important;
}

Again change the path and image filename accordingly. Change 'FolderName' to whatever the name of the particular folder is. Repeat this code throughtout userChrome.css for each folder you want a favicon for.

[edit] Although with this method you would only be able to have unique folder names so using the rdf id would probably be the best way.
"Doesn't the idea of making nature against the law seem to you a bit... unnatural ?" - Bill Hicks
"Money is the Schrodinger's Cat of economics." - Robert Anton Wilson
"It's not a bug, it's two features having a fight in the pub car-park." - Me

lilygotsilly
 
Posts: 121
Joined: April 11th, 2005, 8:24 pm

Post Posted December 12th, 2005, 5:38 pm

Thanks for your replies , but I was under the impression that using extensions is more secure than adding a lot of code. That's why I was wondering if anyone is working on an extension for this problem.

If I were to use this code what do I need to change "true" to?

RaiseMachine

User avatar
 
Posts: 1764
Joined: December 6th, 2004, 6:05 pm
Location: England

Post Posted December 12th, 2005, 7:04 pm

All you're doing is adding CSS declarations to a file that is designed to override defaults.
There is no security issue with this approach.
It is extensions that are likely to have "holes." Saying that, I know of only one that has had problems in this regard and I believe that it's been fixed.

You don't have to change "true" to anything, this part refers to the bookmark item being a folder and not just a reference to a URL - folders full of URLs are bookmarks too.
You will want to change "FolderName" (as already mentioned) to whatever folder you want/need to change the icon for eg "Music" or "Games" etc.

You have to also change the url part within the single quotes. This refers to where the image file is to be found - in my example, I'm using a local file ie a file on my harddrive. If you want to use a remote file ie a file on the web, you would change this to http://something.com/whatever.png
"Doesn't the idea of making nature against the law seem to you a bit... unnatural ?" - Bill Hicks
"Money is the Schrodinger's Cat of economics." - Robert Anton Wilson
"It's not a bug, it's two features having a fight in the pub car-park." - Me

michichi

User avatar
 
Posts: 44
Joined: November 13th, 2005, 12:48 pm
Location: Austria

Post Posted December 13th, 2005, 8:35 am

still, an extension doing this without the need to play with the code for us non programmer would be nice

extension that do this with a gui,

something like favicon picker for all firefox folder icons - folder icon picker or

FFI - FFIconpicker - a firefox favicon and foldericon picker extension - that just sounds good [-o<

i am sure, this would be one of the favorite extension for most

so i call \:D/ all you great firefox developing enthusiasts, please, make such an extension for us!

michichi
"I don´t know where we are going, or how we will get there, but when we will get there, we will be there, and that´s something, even if it´s nothing...." (unknown)

lilygotsilly
 
Posts: 121
Joined: April 11th, 2005, 8:24 pm

Post Posted December 13th, 2005, 10:27 am

michichi wrote:still, an extension doing this without the need to play with the code for us non programmer would be nice

extension that do this with a gui,

something like favicon picker for all firefox folder icons - folder icon picker or

FFI - FFIconpicker - a firefox favicon and foldericon picker extension - that just sounds good [-o<

i am sure, this would be one of the favorite extension for most

so i call \:D/ all you great firefox developing enthusiasts, please, make such an extension for us!

michichi


Michichi basically summed up what I was trying to express.

Now, I have another issue -- again I've never had a problem with my favicons until I upgraded to 1.5. Coincidence? Maybe.

I had a favicon on my toolbar of a horse running along a track: (http://www.findagrave.com/photoThumbnai ... 032024.gif)
the horse is no longer running as of 2 days ago. The image is still there , but its frozen. This favicon had been working for me fine for 2 months.

RaiseMachine

User avatar
 
Posts: 1764
Joined: December 6th, 2004, 6:05 pm
Location: England

Post Posted December 13th, 2005, 5:24 pm

I agree with Michichi that there should be an option to change bookmark folder icons using a UI.

The only way this is going to happen is for someone to work out how to do this and submit the code to Torisugari (favicon picker extension dev) and ask for it to be included. Or to take this code and add it to the 1.5 compatible build of said extension themselves and submit it to us here for testing and feedback.

BTW: this feature won't be a standard feature of FF any time soon or at all according to Bug 173988: allow user to choose an icon for each bookmark folder as this bug is flagged as WONTFIX.
"Doesn't the idea of making nature against the law seem to you a bit... unnatural ?" - Bill Hicks
"Money is the Schrodinger's Cat of economics." - Robert Anton Wilson
"It's not a bug, it's two features having a fight in the pub car-park." - Me

Lee_Dailey

User avatar
 
Posts: 14194
Joined: July 27th, 2004, 4:33 pm
Location: milky way galaxy, sol system, terra, north america, usa, tx, bedford

Post Posted December 14th, 2005, 12:10 am

lilygotsilly wrote:
Now, I have another issue -- again I've never had a problem with my favicons until I upgraded to 1.5. Coincidence? Maybe.

I had a favicon on my toolbar of a horse running along a track: (http://www.findagrave.com/photoThumbnai ... 032024.gif)
the horse is no longer running as of 2 days ago. The image is still there , but its frozen. This favicon had been working for me fine for 2 months.


howdy lilygotsilly,

[1] if you leave a space clear on each end a url it will be "live". lookee ...

- no space ...
(http://www.findagrave.com/photoThumbnai ... 032024.gif)
- space
( http://www.findagrave.com/photoThumbnai ... 032024.gif )

[2] for me - IF i set gif animations to the default of "normal" - the icon onthe TAB is live.

i use anidisable and replayanimation to control gifs and my usual setting for gif is "once". perhaps you have gifs set to none or once?

take care,
lee

lilygotsilly
 
Posts: 121
Joined: April 11th, 2005, 8:24 pm

Post Posted December 14th, 2005, 7:29 pm

Thanks for the reply. I put spaces like you said and it didn't do anything. I never had spaces before and it always worked until like a week ago.

I didn't really understand the software you were taliking about on your second point.

Could this favicon issue along with the video issues have something to do with my add or cookie settings with my firewall? (ezarmor)

Lee_Dailey

User avatar
 
Posts: 14194
Joined: July 27th, 2004, 4:33 pm
Location: milky way galaxy, sol system, terra, north america, usa, tx, bedford

Post Posted December 15th, 2005, 3:11 am

howdy lilygotsilly,

[1] i was unclear. [*grin*]

my "add spaces" note was ONLY in reference to posting links. as you will see in my post above, the 1st url starts with "(http" and the 2nd starts with "( http". note the space between the url and the "("" ... and the fact that the 2nd url is live - clickable in other words.

[2] i was unclear AGAIN! [*grin*]

the animation problem is not likely to be affected by cookies.

there is a user preference to control the animation of gif files. it's this ...
http://kb.mozillazine.org/Firefox_:_Tip ... ted_Images

my "anidisable" and "replayanimation" comments were to ff extensions that give you context menu control of that pref. lookee ..
https://addons.mozilla.org/extensions/m ... on=firefox
http://www.extensionsmirror.nl/index.ph ... +animation

i suspect that you have somehow set that pref to NONE. [*grin*] you can find out right quick by useing about:config and filtering for "ani".

- how to use about:config
http://tinyurl.com/5v6ho

take care,
lee

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 1 guest