Simple Python script to let you (easily) apply favicons to bookmarklets.
Credit to http://www.nomachetejuggling.com/2012/03/30/how-to-clean-up-your-chrome-bookmark-bar/ for inspiration and explanation.
Export your Chrome bookmark HTML and do the following:
python show-missing-favicons.py userdata/bookmarks.unprocessed.html | python autodetect-favicons.py | python render-importable-html.py > userdata/import-me.html
This will create
userdata/import-me.html which can be imported in to Chrome. Importing this file in to Chrome's bookmark manager will create a new folder called "Imported" (or "Imported (1)" if it already exists, etc.) which will contain copies of all bookmarklets for which favicon auto-detection succeeded.
- Improved auto-detection of favicons
- Potentially build a library of popular replacements
- Support meta tag declaration of favicon as well as
- More favicon sources
- Support for popular icon libraries such as Silk
- Support for importing local icons disk
- Better integration
- External graphical editor?
- Automating export/import/delete "Imported" folder
- Doesn't seem to be designed for this
- AutoIt or Automator?
- Windows or Mac only
- Chrome extension
- http://developer.chrome.com/extensions/bookmarks.html has no support for icons
- http://code.google.com/p/chromium/issues/detail?id=59519 tracks this
- Direct editing of profile?
- Requires Chrome to be closed
- Requires re-calculating checksums
- Support for non-bookmarklet bookmarks
- Better documentation
- No threading of icon downloads.
- Minimal caching; will download favicons many times if they are used by many bookmarklets.
- Ignores hash and emits multiple (useless) copies of the same bookmarklet if it is present many times in the source.
- Manual rendering of json is hackish and inelegant.
- ujson dies if there is a trailing whitespace in input; currently using builtin json to circumvent this.
Each tool has a separate, simple, function.
Consumes a bookmark export file and produces a JSON dump of every bookmarklet without an icon. Does some crude matching to see if there's a source domain hiding in the bookmarklet. For example, here's the "popup with tags" bookmarklet from http://pinboard.in/howto/:
//pinboard.in/ - and
.in is a valid TLD - so the autodetected domain is
Bookmarklets are ignored if they already have an icon.
The output (JSON) contains for-future-use fields.
Consumes the JSON product of
show-missing-favicons.py in order to download favicons.
The output is the same as
show-missing-favicons.py but the "icon" field will be populated with the detected domain's favicon.
Currently lacks both threading and caching; may also download the same favicon several times as a result.
Consumes the JSON product of
autodetect-favicons.py and produces an importable HTML bookmark file. Only bookmarklets with icons will be present in the output.