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.
You can try out the online demo to see hotlink.js in action.
- Chrome 12+
- Edge
- Firefox
- Safari 5.1+
- Internet Explorer 11+
Unlisted browsers may still be supported. Unsupported browsers 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);
This library is only to be used for research purposes and I am not responsible for anything you make with this library.