Skip to content

Instantly share code, notes, and snippets.

@dstarh
Created August 30, 2012 13:12
Show Gist options
  • Save dstarh/3528258 to your computer and use it in GitHub Desktop.
Save dstarh/3528258 to your computer and use it in GitHub Desktop.

Custom Favicons for sites See - https://skitch.com/dstarh/exi5e/menubar - these are my custom github icons that tell me which project I'm in without having to click the tab

Note this was done in chrome but will likely work in firefox with greasemonkey

  • Install Tamper Monkey
  • Create a new userscript based on the attached user script changing the match url and the url in the addFavicon (note for my images i just used skitch and shared the links you can get the direct image link from the link page)
  • note the match url can be any part of a domain with * replacing any portion of it.
  • Reload the page, it should now have your custom favicon
// ==UserScript==
// @name custom favicon for XXXXXXXX
// @namespace https://github.com/favicon
// @version 0.1
// @description enter something useful
// @match https://github.com/ORGANIZATION/PROJECT/*
// @copyright 2012+, You
// ==/UserScript==
$(document).ready(function() {
addFavicon("https://img.skitch.com/20120830-x65rmk7d5aiyb4jnjgy55wpyhc.jpg")
});
function addFavicon(url) {
console.log("Greasemonkey script for adding Favicon: " + url);
var link = document.createElement("link");
link.type = "image/x-icon";
link.rel = "shortcut icon";
link.href = url;
$("head")[0].appendChild(link);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment