最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

浏览器注入

运维笔记admin1浏览0评论

浏览器中引入外部jQuery:

var script = document.createElement("script")
script.type = "text/javascript";
script.src = "https://cdn.bootcdn/ajax/libs/jquery/2.2.0/jquery.js";
document.getElementsByTagName("head")[0].appendChild(script);

模拟鼠标点击的三种方法:

$("#root > div > div:nth-child(3) > div").trigger('click');
document.querySelector("#root > div > div:nth-child(3) > div").click();
$("#root > div > div:nth-child(3) > div").click();

获取元素循环打开:

$('.ant-checkbox-input').each(function(index, domEle) {
    var openUrl = domEle.value;
    console.log(openUrl);
    if (openUrl != "") {
        window.open(openUrl, "_blank");
    }
})

打开新窗口:

window.open(openUrl, "_blank");
window.open(openUrl,'newWin','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,draggable=false,width=500,height=150');

一秒点击一次:

setInterval(function () {
   $("#clickme").trigger('click')
}, 1000);
<script type="text/javascript">
    var button = document.getElementById("btn");
    //每秒执行一次,若按钮状态为可用,进行点击
    setInterval(function() {
        if (button.disabled == false) {
            button.click();
        }
    },
    1000);
</script>

 

发布评论

评论列表(0)

  1. 暂无评论