Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
My staging version of the Typekit Colophon bookmarklet
(function() {
var a = document.getElementsByTagName('script'),
i, l, result,
rurl = /^http(s?):\/\/use\.typekit\.com\/([0-9A-Za-z]+)\.js/;
for (i = 0, l = a.length - 1; i < l; i++) {
if (result = rurl.exec(a[i].getAttribute('src'))) {
window.location.assign('' + result[1]);
if (!result) {
alert('This site doesn\'t use Typekit!');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment