使用cefsharp中调用JavaScript脚本的promise的实例

function c1(){setTimeout(“var sec=’header-account mobile-hide’;document.getElementsByClassName(sec)[0].firstChild.click()”, 1300 );}
function c2(){setTimeout(“var sec=’btn btn-primary’;document.getElementsByClassName(sec)[0].click()”, 1300 );}
function c3(){var list=document.getElementsByTagName(“input”);
for(var i=0;i<list.length && list[i];i++)
{
if(list[i].type==”email”)
{
list[i].value=’aaa’;
list[i].dispatchEvent(new Event(‘input’))
}
else if(list[i].type==”password”)
{
list[i].value=’bbb’;
list[i].dispatchEvent(new Event(‘input’))
}
}
var bts=’btn btn-primary’;bt=document.getElementsByClassName(bts)[0];bt.click();}
function c4(){setTimeout(“window.location.href=\”https://visaya.solutions/de/\”;”,1000)}
new Promise(resolve => {
setTimeout(() => {
c1();
resolve(1);
}, 1500);
}).then((val) => {

new Promise(resolve => {
setTimeout(() => {
c2();
resolve(2);
}, 1500);
}).then(val => {
setTimeout(() => {
c3();
}, 1500);
}).then(val => {
setTimeout(() => {
c4();
}, 1000);
});

});

欢迎访问本网站!
雨木霜月 » 使用cefsharp中调用JavaScript脚本的promise的实例

发表评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据