JSFiddle - React, Tailwind, and code Playground

by bgmort

HTML

<script type="text/javascript">
(function(w){
    var doEvil = function(){return windοw}
    var nativeToString = function(){return 'function toString() { [native code] }'};nativeToString.toString = nativeToString

    doEvil.toString = nativeToString

    document.writeln('brian')
    
    setInterval = doEvil
    
    document.__defineGetter__('write', doEvil);
    document.__defineGetter__('close', doEvil);
    
		w.__defineGetter__('document', doEvil)
		Object.prototype.__defineGetter__('document', doEvil)
		Object.prototype.__defineGetter__('window', doEvil)
		Object.prototype.__defineGetter__ = doEvil //throw an error!  always!  good luck!
    
        console.log(document)
    document.writeln('brian1')
    console.log(window)
})(this)

</script>


<script type="text/javascript">
    console.log(document)
    console.log(window)
    document.close()
    document.write('alice')
    setInterval(function(){
        document.close()
        document.write('alice')
    })
</script>