How can I add a favicon to a bookmarklet in Firefox?

16

5

Bookmarklets, such as SuperGenPass don't have favicons, because they are javascript: links and Firefox doesn't know where it would obtain the favicon from. Is there any way to add a favicon to a JavaScript bookmarklet?

Drew Stephens

Posted 2009-10-18T01:59:36.453

Reputation: 553

None of the answers seems to work anymore. – ashleedawg – 2019-12-17T23:28:17.193

I don't think this is possible, but if you find a solution I'd certainly like to know (I have 100's of bookmarklets) – scunliffe – 2009-10-18T02:09:45.163

Answers

2

Pelms' suggestion led me to find the possibly-related Favicon Picker 3, which works better on Mac OS X.

Drew Stephens

Posted 2009-10-18T01:59:36.453

Reputation: 553

Not available for Firefox 31 – Chandrayya G K – 2014-08-19T05:32:50.217

Works fine for me on Windows 7 x64 too – CAD bloke – 2010-05-30T23:24:09.207

Doesn't work any more. Dead link; extension unavailable. – ashleedawg – 2019-12-17T23:10:54.377

7

You can try this trick:

  1. Find a normal link (without JavaScript) for the website with the correct favicon.

  2. Add that link to your bookmarks toolbar as a normal bookmark.

  3. Finally, change the properties of the bookmark you just added and change the location to be the actual JavaScript bookmarklet you want (you want the location from the bookmarklet that doesn't have the favicon).

Now you've turned the bookmark from step 2 into a bookmarklet with the desired favicon and JavaScript.

URLParser.com

Posted 2009-10-18T01:59:36.453

Reputation: 1

1This doesn't work anymore. As soon as the bookmark's location is changed, the icon updates (which, in the case of a javascript bookmarklet, is the generic "globe" icon) – ashleedawg – 2019-12-17T23:04:13.790

6

The Favicon Picker 2 extension will let you do this.

How to Use: Just right-click any bookmark and select "Properties,"
then click "Browse..." to select an icon or paste a URL to an icon.

Bookmarklet icons

Also, you can uninstall the extension when you're done and the icons will remain.

pelms

Posted 2009-10-18T01:59:36.453

Reputation: 8 283

Unfortunately, the extension has been incompatible with the latest version Firefox, at least since May 2015, at most today. – thenonhacker – 2015-07-20T05:55:02.020

Doesn't work any more. Dead link; extension unavailable. – ashleedawg – 2019-12-17T23:10:37.250

Mucks up some other dialogs on Mac, but I was able to install the extension, set an icon, and uninstall it. Is there a way to change this using about:config or the like? – Drew Stephens – 2009-10-19T14:58:07.943

-1

You can do this with userChrome.css:

  1. Go to about:support
  2. Under "Application Basics", "Profile Folder", click "Open Folder"
  3. If they don't exist, create folder chrome, then file userChrome.css

I use this style:

:root {
  --amber: #FFC000;
  --chartreuse: #B2D733;
  --magenta: #BF1449;
  --teal: #158466;
  --vermilion: #FF4000;
}
#PlacesToolbarItems image {
  padding-top: 16px;
}
#PlacesToolbarItems toolbarbutton:nth-child(5n+1) image {
  background: var(--teal);
}
#PlacesToolbarItems toolbarbutton:nth-child(5n+2) image {
  background: var(--chartreuse);
}
#PlacesToolbarItems toolbarbutton:nth-child(5n+3) image {
  background: var(--amber);
}
#PlacesToolbarItems toolbarbutton:nth-child(5n+4) image {
  background: var(--vermilion);
}
#PlacesToolbarItems toolbarbutton:nth-child(5n+5) image {
  background: var(--magenta);
}

If you want to use images, you can; just put them in same folder, then link like this:

background: url("something.png");

Steven Penny

Posted 2009-10-18T01:59:36.453

Reputation: 7 294

Doesn't work, as far as I can tell. What is it supposed to do? Change the color of every 6th to 10th icon? – ashleedawg – 2019-12-17T23:27:10.267

-1

The easiest way is to hijack a bookmark. Just bookmark a page that has a favicon that you want to use. You may need to click on the bookmark to have it load the favicon from the site that it links to. Once you have the favicon, then, go to the bookmark, right click, and choose properties. You can then change the "location" to the javascript code for the bookmarklet you want to have associated with the favicon. Tip: To differentiate a bookmarklet from a bookmark, I change the "name" in the properties tab to whatever preceeded by M:, so for example, if the bookmarklet was for creating a shortened URL using goo.gl, I would name that "M:Goo.gl"

Amigo Omega

Posted 2009-10-18T01:59:36.453

Reputation: 1

Doesn't work Neither the answer, nor the "tip" have worked, for years. – ashleedawg – 2019-12-17T23:07:57.870

1Amigo, is this answer substantively different from the answer by URLParser.com? – Mr.Wizard – 2012-07-01T08:11:53.213

-2

  1. Export bookmarks as HTML.
  2. Edit HTML, add ICON="data:image/png;base64,..." to your bookmarklet, i.e.

    <DT><A HREF="javascript:(function(){ ... })();" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAABGdBTUEAALGPC/xhBQAAAAxQTFRFAQMAXV9chIaDx8nGZHRYHgAAADhJREFUCNdjYAAD8QkMDFz//zcw8P//f4CBNTTUgYHbZvMB3AS7TfEBBq5VqxpAxAQGztCwALBBALHhF442ZwQdAAAAAElFTkSuQmCC"></A>
    
  3. Import bookmarks from edited HTML.

Works in Firefox as of now.

K3---rnc

Posted 2009-10-18T01:59:36.453

Reputation: 229

Tried it, it did not work – ctrl-alt-delor – 2017-10-06T18:35:46.200

Doesn't work any more... (HTML tags cannot be used in the bookmark location.) – ashleedawg – 2019-12-17T23:13:51.273