Last Updated: February 25, 2016
· earl3s

Stop someone from highjacking your work with an iFrame

You can block a specific domain from embedding your website if you don't mind your content in some locations but don't want it on a certain site. For example, if was embedding your content, you could do this:

<script type="text/javascript">
    if(document.referrer.indexOf("") != -1) {
        window.location = "";

This would check the parent document's location and see if it's the that is embedding your content. This script will then send that iframe to a certain famous youtube video as punishment. In effect they just Rick-Rolled themselves.