手机html调试工具 在浏览器地址栏粘贴以下代码,出现齿轮,即是eruda调试工具 javascript:(function () { var script = document.createElement('script'); script.src="//cdn.jsdelivr.net/npm/eruda"; document.body.appendChild(script); script.onload = function () { eruda.init() } })();
//隐藏元素 var myCss= document.createElement('style'); myCss.innerHTML='.txp_waterMark_pic,.logo-new,.iqp-logo-box{display:none!important;}'; document.body.appendChild(myCss); void(0);
编辑网页文字 document.querySelector("body").contentEditable="true";
编辑网页背景颜色 document.querySelector("body").style.backgroundColor = "red";
编辑网页文字颜色 document.querySelector("body").style.color = "red";
//改变网页文字大小 document.querySelector("body").style.fontSize ="40px"; //改变网页文字行高 document.querySelector("body").style.lineHeight= "50px";
在开头添加按钮 document.body.insertAdjacentHTML("afterbeg "<button>按钮</button>";
在末尾添加按钮 var para=document.createElement("button"); para.innerHTML="我是新按钮"; document.querySelector("body").appendChild(para);
//添加浮动按钮 var para=document.createElement("button"); para.innerHTML="我是新按钮"; para.style.position="fixed"; para.style.right="40px"; para.style.top="100px"; document.querySelector("body").appendChild(para); //点击浮动按钮 para.onclick=function(){alert("mn")};
//添加浮动按钮 var oneInner = document.createElement("div"); oneInner.setAttribute("style","background:#663398;position:fixed;width:100px;height:100px;border:solid 3px #2F74A7;top:30px;"); var oneButton = document.createElement("input"); oneButton.setAttribute("type","button"); oneButton.setAttribute("vlue","复制"); oneInner.appendChild(oneButton); document.body.appendChild(oneInner); //点击浮动按钮 oneButton.onclick=function(){alert("mn")};
米侠浏览器保存txt window.mx_browser_obj.savatxt(document.body.innerText,"名字")//保存浏览器显示的一切 window.mx_browser_obj.savatxt(document.body.innerHTML,"名字")//保存网页body源码,txt改为html可以变成和原网页差不多的网页 window.mx_browser_obj.savatxt(document.documentElement.innerHTML,"名字")//保存网页全部源码,txt改为html可以变成和原网页差不多的网页
//添加浮动按钮复制浏览器内容 //添加浮动按钮 var para=document.createElement("button"); para.innerHTML="点我复制"; para.style.position="fixed"; para.style.right="40px"; para.style.top="100px"; document.querySelector("body").appendChild(para); //点击浮动按钮 para.onclick=function() { var wz=document.createElement("input"); wz.type="text"; document.body.appendChild(wz); wz.value=document.querySelector("body").innerText; wz.select(); document.execCommand("Copy"); // 执行浏览器复制命令 alert("已复制好,可贴粘。"); }
复制文*库文字(电脑) var wz=document.createElement("input"); wz.type="text"; document.body.appendChild(wz); wz.value=document.getElementsByClassName("ie-fix")[1].innerText+document.getElementsByClassName("ie-fix")[3].innerText+document.getElementsByClassName("ie-fix")[5].innerText; wz.select(); document.execCommand("Copy");
复制文*库内当前页面文字(电脑) var wz=document.createElement("input"); wz.type="text"; document.body.appendChild(wz); wz.value=document.querySelector("body").innerText; wz.select(); document.execCommand("Copy"); // 执行浏览器复制命令
更改meta var d = document.createElement('meta'); d.innerHTML = ' <meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> '; document.getElementsByTagName('head')[0].appendChild(d);
更改style var d = document.createElement('style'); d.setAttribute('type', 'text/css'); d.innerHTML = 'p { color: red !important;}'; document.getElementsByTagName('head')[0].appendChild(d);
删除div var m = document.getElementById("这里填写要去处的元素ID"); m.parentNode.removeChild(m);
var n = document.getElementsByClassName("这里填写要去处的元素ClassName")[0]; n.parentNode.removeChild(n);
找到元素对象的代码 document.getElementById("mark"); document.getElementsByClassName("timeAD")[0]; document.getElementsByTagName("html")[0];
给元素设置属性值 document.getElementsByTagName("html")[0].setAttribute("style","overflow: auto;");
删除元素 var n = document.getElementsByClassName("timeAD")[0]; n.parentNode.removeChild(n);
复制网页文字的方法 控制台,输入【$=0】然后按回车键 地址栏输入javascript:void($={}); 按住【ctrl+p】组合键,页面弹出打印网页的界面,这样在这个页面里所有的文字就都可以复制啦! 禁用JS:点击IE浏览器的“工具”—“Internet选项”菜单,切换到“安全”标签页,选择“自定义级别”,将所有脚本全部禁用。 首先按下【Ctrl+D】将任意页面添加到收藏夹中,然后修改里面的内容。将名字修改为一个方便自己记忆的名称,然后将网址修改为:
javascript:alert(document.onselectstart = document.onbeforecopy = document.oncontextmenu = document.onmousedown = document.onkeydown = function(){return true;});void(document.body.onmouseup=''); void(document.body.onselectstart=''); void(document.body.onmouseup=''); void(document.body.oncopy=''); 保存即可。 今后再遇到无法复制的内容时,直接点一下收藏夹的这个工具之后,你就会发现这个页面上的内容已经可以自由复制了。 6.选择浏览器的“工具”菜单中的“Internet选项”命令,在打开的对话框中选“安全”,用鼠标将'安全级’滑块从中级向上拖到高级,然后选“应用”按钮后再选“确定”按钮。然后重新打开禁止保存和复制的网页(关闭后重新打开),鼠标在网页文字和图片上拉一下看是否可以选中范围,点击右键是否弹出快捷菜单,怎么样?右键功能全恢复了,可以复制粘贴,又可以保存了。
//刷新
setInterval(time,1000*60*2); function time() {document.getElementsByClassName("studyCourseTimeRefresh")[0].click();}
var dsq=setInterval(time,1000*60*4); function time(){ clearTimeout(timer1); document.getElementsByClassName("studyCourseTimeRefresh")[0].click(); var shij=Math.floor(Math.random() * 4+1); var timer1=setTimeout(dsq,shij*1000); }
|