Skip to content

Instantly share code, notes, and snippets.

@Milly
Last active August 29, 2015 13:59
Show Gist options
  • Save Milly/10657235 to your computer and use it in GitHub Desktop.
Save Milly/10657235 to your computer and use it in GitHub Desktop.
bitly bitmarklet fix.
<html>
<body>
Bookmarklet:
<a href="javascript:(function(d,a,b,s)%7Bif(s=d.getElementById(b))%7Bs.parentNode.removeChild(s);alert(%22bitly%20closed%22);return;%7Ds=d.createElement(%22script%22);s%5Ba%5D(%22id%22,%22bitmark_js%22);s%5Ba%5D(%22type%22,%22text/javascript%22);s%5Ba%5D(%22src%22,%22//bitly.com/a/bitmarklet.js%22);d.addEventListener(%22load%22,function(e,f)%7Bf=d.getElementById(b);if(e.target===f)f.style.height=f.style.width=%22100%25%22;%7D,true);(d.body%7C%7Cd.getElementsByTagName(%22head%22)%5B0%5D).appendChild(s);%7D)(top.document,%22setAttribute%22,%22bitmark_yoself_fool%22);">&#x271a; bitmark</a>
</body>
(function(d, a, b, s){
if(s=d.getElementById(b)){
s.parentNode.removeChild(s);
alert("bitly closed");
return;
}
s=d.createElement("script");
s[a]("id", "bitmark_js");
s[a]("type", "text/javascript");
s[a]("src", "//bitly.com/a/bitmarklet.js");
d.addEventListener("load", function(e, f){
f=d.getElementById(b);
if(e.target===f)
f.style.height=f.style.width="100%";
}, true);
(d.body||d.getElementsByTagName("head")[0]).appendChild(s);
})(top.document, "setAttribute", "bitmark_yoself_fool");
javascript:(function(d,a,b,s)%7Bif(s=d.getElementById(b))%7Bs.parentNode.removeChild(s);alert(%22bitly%20closed%22);return;%7Ds=d.createElement(%22script%22);s%5Ba%5D(%22id%22,%22bitmark_js%22);s%5Ba%5D(%22type%22,%22text/javascript%22);s%5Ba%5D(%22src%22,%22//bitly.com/a/bitmarklet.js%22);d.addEventListener(%22load%22,function(e,f)%7Bf=d.getElementById(b);if(e.target===f)f.style.height=f.style.width=%22100%25%22;%7D,true);(d.body%7C%7Cd.getElementsByTagName(%22head%22)%5B0%5D).appendChild(s);%7D)(top.document,%22setAttribute%22,%22bitmark_yoself_fool%22);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment