Created
March 5, 2014 17:31
-
-
Save nickgartmann/9372077 to your computer and use it in GitHub Desktop.
A bookmarklet for setting the favicon of google analytics to the number of people currently on your site. (Will break not update if not navigated to the real time page - I suggest leaving it sit as a pinned tab)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:var thing=function(){var e=parseInt(document.getElementById("ID-overviewCounterValue").innerText);[].slice.call(document.querySelectorAll("link[type='image/x-icon']")).forEach(function(e){e.parentNode.removeChild(e)});var t=document.createElement("canvas");t.width=16;t.height=16;var n=t.getContext("2d");var r=function(){n.font="bold 10px sans-serif";n.fillText(e,e>9?2:4,12);var r=document.createElement("link");r.type="image/x-icon";r.rel="shortcut icon";r.href=t.toDataURL("image/x-icon");document.getElementsByTagName("head")[0].appendChild(r)};r()};setInterval(thing,1e3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment