Last active
February 17, 2021 10:47
-
-
Save divinity76/9d5842797317ad5d1917 to your computer and use it in GitHub Desktop.
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(){ | |
const beep=function(){ | |
let beepElement = document.getElementById("beepElement"); | |
if(!beepElement){ | |
beepElement = document.createElement("audio"); | |
beepElement.id = "beepElement"; | |
beepElement.autoplay=false; | |
beepElement.src="https://images.wikia.com/monchbox/images/0/01/Beep-sound.ogg"; | |
document.head.appendChild(beepElement); | |
} | |
beepElement.play(); | |
}; | |
var iframe = document.createElement("iframe"); | |
var check = function () { | |
check.new = iframe.contentWindow.window.document.body.innerHTML.toString(); | |
check.new = check.new.replace(/\<span id\=\"paristz\" class\=\"bold\"\>.*?\<\/span\>/gim, "cats"); | |
if (check.old == undefined) { | |
check.old = check.new; | |
iframe.contentWindow.window.location.reload(); | |
return; | |
}; | |
if (check.old != check.new) { | |
//my job here is done! | |
setInterval(beep, 200); | |
return; | |
}; | |
check.old = check.new; | |
iframe.contentWindow.window.location.reload(); | |
return; | |
}; | |
var src = window.location.toString(); | |
document.body.appendChild(iframe); | |
iframe.addEventListener("load", check); | |
iframe.addEventListener("error", check); | |
iframe.addEventListener("error", beep); | |
iframe.src = src; | |
//iframe.contentWindow.window.location.reload() | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment