Skip to content

Instantly share code, notes, and snippets.

@TestSmirk
Last active February 9, 2020 09:02
Show Gist options
  • Save TestSmirk/a0a19f683083a7843f621f635b61cec7 to your computer and use it in GitHub Desktop.
Save TestSmirk/a0a19f683083a7843f621f635b61cec7 to your computer and use it in GitHub Desktop.
多点 抢口罩 北京
timeout=prompt("Set timeout (Second):");
count=0;
var setTimeOut;
current=location.href;
var isVisiable=false;
if(timeout>0){
setTimeOut = setInterval('reload()',1000*timeout);
} else{
location.replace(current);
}
setTimeout(function () {
isVisiable= true
},5000);
function checkNotNullAndStartIntervalClick(){
console.log("检查")
var frame = window.frames["frame"];
if (!frame)return;
var clickBtn = frame.document.getElementsByClassName("J_btnSubmitOrder")[0];
if(clickBtn){
console.log("clickBtn",clickBtn);
clearInterval(setTimeOut);
setTimeOut=null;
setInterval(clickBtn.click(),100);
}
}
function reload(){
count++;
checkNotNullAndStartIntervalClick();
fr4me='<iframe style="\n' +
' width: 100%;\n' +
' height: 100%;\n' +
'" name="frame" src=\''+current+'\'/>';
// fr4me+='</frameset>';
with(document){write(fr4me);void(close())};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment