hotlink.js makes it possible to hide referrer information for hotlinked images. It is an easy-to-use drop-in script that requires very few changes to your webpages.
This library is only to be used for research purposes and I am not responsible for anything you make with this library.
You can try out the online demo to see hotlink.js in action.
- Google Chrome 12+
- Safari 5.1+
†Firefox 5+, Internet Explorer 9+, and Opera 11.50+ will fall back to a normal image without a hidden referrer.
- Download hotlink.js (unminified).
- Replace
<img src="...">
with<img data-src="...">
for every image that you want to hotlink on your site. - Include
<script type="application/ecmascript" async="" src="hotlink.js"></script>
right before</body>
.
void hotlink(HTMLImageElement image)
If you are using dynamically inserted images, you'll want to use the API to hotlink them.
var image = new Image(300, 100);
image.setAttribute("data-src", "http://example.com/image.png");
document.documentElement.appendChild(image);
hotlink(image);