Created
April 19, 2012 21:21
-
-
Save nekman/2424291 to your computer and use it in GitHub Desktop.
Simple hack, just to be able to right click a link and select "Save as" on Facebook.
This file contains 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
/*! This is just a simple function I wrote to be be able | |
to right click a link on Facebook and select "Save as". | |
Link.append('http://dl.dropbox.com/1.avi') | |
.append('http://dl.dropbox.com/2.mp3') | |
.append('http://dl.dropbox.com/3.jpg') | |
*/ | |
var Link = (function(w, d, undefined) { | |
var template = '<p><a href="{url}">{url}</a></p>', | |
div = d.createElement('div'); | |
d.body.insertBefore(div, d.body.firstChild); | |
return { | |
append : function(url) { | |
div.innerHTML += template.replace(/{url}/g, url); | |
return this; | |
} | |
}; | |
}(this, document)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment