首页 > 开发 > HTML > 正文

扣代码工具 hta版

2020-01-29 17:24:21
字体:
来源:转载
供稿:网友
复制下面的代码,最好用editplus等专业点的编辑工具。
代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>页面内容捕获器</title>
<style>
* { font-size:12px; }
html { padding:0px; margin:0px; border-style:none; border-width:0px; overflow:auto; background-color:buttonface; }
body { padding:0px; margin:0px; border-style:none; border-width:0px; background-color:buttonface; }
li { line-height:24px; height:24px; margin:10px 0px -10px 15px; }
a { color:blue; }
input { border-width:1px; }
#output { width:90%; height:150px; overflow:auto; }
</style>
<script>
var win;
function $(s){ return document.getElementById(s); }
window.onload = function(){
    var myHeight = 320;
    window.moveTo(0,0);
    window.resizeTo(screen.availWidth, myHeight);
    //打开一个浏览器
    win = new ActiveXObject("InternetExplorer.Application");
    win.left = 0; win.top = myHeight;
    win.width = screen.availWidth; win.height = screen.availHeight - myHeight;
    win.navigate2("about:blank");
    win.visible = true;
    setInterval(function(){ try{ win.document; }catch(e){ window.close(); } }, 1); //窗口关闭后自动退出程序
    //页面卸载时关闭浏览器
    window.onunload = function(){ win.quit(); }
    //自动捕获
    setInterval(doCapture, 1);
}
function doCapture(){
    try{
        win.document.onclick = capIt;
    }catch(e){}
}
function capIt(){
    var d = win.document, w = d.parentWindow, e = w.event, el = e.srcElement;
    $("currentObj").bound = el;
    $("currentObj").innerHTML = el.tagName;
    showCapture(el);
    e.cancelBubble = true;
    e.returnValue = false;
    return false;
}
function showCapture(el){
    if(!el)return;
    var oldBorderStyle = el.style.borderStyle, oldBorderWidth = el.style.borderWidth, oldBorderColor = el.style.borderColor;
    el.style.border = "2px solid red";
    setTimeout(function(){ try{ el.style.borderStyle = oldBorderStyle; el.style.borderWidth = oldBorderWidth; el.style.borderColor = oldBorderColor; }catch(e){} }, 300);
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表