MozillaZine

bookmarks.html bloated with binary favicon data

Discussion of general topics about Mozilla Firefox
richey

User avatar
 
Posts: 17
Joined: December 27th, 2006, 10:27 am

Post Posted April 10th, 2007, 4:42 am

Hello,

is it possible to prevent FF from saving favicon data in the bookmarks.html file?

This is really annoing, I'm working on a USB stick and the bookmark file grows by 2-6kb with every bookmark I save or view... not to speak that loading takes considerably longer. My bookmark file is already 2 MB, and growing every day.

Thanks!
r.

RaiseMachine

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

Post Posted April 10th, 2007, 5:09 am

about:config -> Set both of these to false
Code: Select all
browser.chrome.favicons
browser.chrome.site_icons
"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

richey

User avatar
 
Posts: 17
Joined: December 27th, 2006, 10:27 am

Post Posted April 10th, 2007, 5:19 am

COOL - thanks a lot!!!

richey

User avatar
 
Posts: 17
Joined: December 27th, 2006, 10:27 am

Post Posted April 10th, 2007, 5:21 am

p.s. will this just prevent from favicons being saved in the bookmarks.html or also the display of them?

RaiseMachine

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

Post Posted April 10th, 2007, 5:27 am

Both. Although I can't recall whether data already stored is affected...
"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

dickvl

User avatar
 
Posts: 52840
Joined: July 18th, 2005, 3:25 am

Post Posted April 10th, 2007, 1:58 pm

You can also set the value of browser.chrome.image_icons.max_size to 0 (the number).

the-edmeister

User avatar
 
Posts: 32221
Joined: February 25th, 2003, 12:51 am
Location: Chicago, IL, USA

Post Posted April 10th, 2007, 3:24 pm

To remove existing Favicons from your bookmarks file:

1. Create a new Bookmark and save this code in the Location field in Properties.
2. Open your bookmarks.html file in the browser window - {Ctrl+O} or {File > Open File...}
3. Run the bookmarklet to strip the existing Favicons.
4. {Ctrl+S} or File > Save Page As... - to save the file
5. Replace the existing bookmarks.html file in your Profile folder with the newly saved one, sans Favicons.
Code: Select all
javascript:(function(){ var ls=document.getElementsByTagName('*'); for (var i=0; i<ls.length; i++) {l=ls[i]; l.removeAttribute('id'); l.removeAttribute('last_charset'); l.removeAttribute('icon'); l.removeAttribute('last_modified'); l.removeAttribute('last_visit'); l.removeAttribute('add_date'); l.removeAttribute('personal_toolbar_folder');} alert('Cleanup Complete - Save as Web Page, Complete')})();

Favicons can take up 85% of the total size of a typical bookmarks.html file! I have stripped the Favicons from a 2.5MB bookmarks.html file and ended up with a file of 464KB, a few times.


Ed
A mind is a terrible thing to waste. Mine has wandered off and I'm out looking for it.

richey

User avatar
 
Posts: 17
Joined: December 27th, 2006, 10:27 am

Post Posted April 10th, 2007, 3:41 pm

Hi Ed and others,

thanks for the hint- meanwhile I've found the following: there are 4 settings to influence favicons -

// http://kb.mozillazine.org/Browser.chrome.site_icons ; overwrites all
user_pref("browser.chrome.site_icons",false);
// http://kb.mozillazine.org/Browser.chrome.favicons
user_pref("browser.chrome.favicons",false);
// http://kb.mozillazine.org/Browser.chrom ... s.max_size
user_pref("browser.chrome.image_icons.max_size",0);
// http://kb.mozillazine.org/Browser.chrom ... lbar_icons
user_pref("browser.chrome.load_toolbar_icons",0);

ALL of these settings have to be enabled or disabled to enable/disable the saving of the bloating favicons in the bookmarks file - but there is NO individual setting just influencing the bookmarks file. So, either you don't SEE any favicons at all or you SEE & SAVE them ... automatically, without any choice.
:-( :-( :-(
That's not good for portable / USB stick users!

Ed, I found an easier way: close FF, then open bookmarks.html with a good editor such as Wordpad ;-), and replace all occurances of "ICON=" by some crap like "ICXON=". After the next reload, the bookmark file will be "cleaned". As always, backup the file first. 8-)

greetz, r

the-edmeister

User avatar
 
Posts: 32221
Joined: February 25th, 2003, 12:51 am
Location: Chicago, IL, USA

Post Posted April 12th, 2007, 10:47 am

... replace all occurances of "ICON=" by some crap like "ICXON=". After the next reload, the bookmark file will be "cleaned".

Didn't know that would work, although it makes sense now that you mention it. Firefox seems to have the ability to 'heal' minor mistakes (that I have made) in the bookmarks.html file.


Ed
A mind is a terrible thing to waste. Mine has wandered off and I'm out looking for it.

dickvl

User avatar
 
Posts: 52840
Joined: July 18th, 2005, 3:25 am

Post Posted April 13th, 2007, 8:34 am

The last pref in your post only works in Moz. Suite and SeaMonkey:
http://kb.mozillazine.org/Browser.chrom ... lbar_icons
* Mozilla Suite (all versions since 1.6 Alpha)
* Mozilla SeaMonkey (all versions)

So the other three are sufficient.

hydreux
 
Posts: 237
Joined: August 11th, 2003, 9:32 pm

Post Posted January 10th, 2008, 7:22 pm

on another note, is there a way to strip more data such as "add_date", "last_modified" and "id=rdf:#$xxxxx"? the reason is that i'd like to compare bookmarks from two different PCs but prefer not to use online synch tools.

dickvl

User avatar
 
Posts: 52840
Joined: July 18th, 2005, 3:25 am

Post Posted January 10th, 2008, 9:12 pm

All the attributes mentioned in the JavaScript code should be removed.
With all attributes removed there shouldn't be a problem to compare files and import still works without those attributes.
If you want to keep some attributes then remove the corresponding l.removeAttribute('???') code.
Code: Select all
javascript:(function(){ var ls=document.getElementsByTagName('*'), lsl=ls.length; for (var i=0; i<lsl; i++) {l=ls[i]; l.removeAttribute('id'); l.removeAttribute('last_charset'); l.removeAttribute('icon'); l.removeAttribute('last_modified'); l.removeAttribute('last_visit'); l.removeAttribute('add_date'); l.removeAttribute('personal_toolbar_folder');} alert('Cleanup Complete - Save as Web Page, Complete')})();

hydreux
 
Posts: 237
Joined: August 11th, 2003, 9:32 pm

Post Posted January 12th, 2008, 10:51 am

thanks dickvl, it works great! on another note, can it be modified to change all instances of "&amp;" to plain "&"?

dickvl

User avatar
 
Posts: 52840
Joined: July 18th, 2005, 3:25 am

Post Posted January 12th, 2008, 3:59 pm

You're welcome.

Sorry, I don't know about the &amp; (maybe with a regular match / replace).
Do you want to remove that from the url or from other (all) attributes?
I don't know if it can cause problems, so why don't you lust leave those entities.

You can do that in a text editor (Find/Replace) if you want.

hydreux
 
Posts: 237
Joined: August 11th, 2003, 9:32 pm

Post Posted January 12th, 2008, 10:16 pm

i'm not sure how but the some of the "&" in the urls esp. google's search query gets changed into "&amp;" thus breaking the url. that's why i'm asking but anyway i had used a text editor to make the changes.

Return to Firefox General


Who is online

Users browsing this forum: No registered users and 5 guests