
说明
有时候需要复制当前网页的标题和网址来想分享一下,
比如看到一个有意思的文章或者网站。
部分浏览器会自带这个功能,
但是我还是喜欢很酷得呢
下面采用浏览器书签来获取网页所需内容链接
添加书签代码教程
将代码粘贴至书签网址保存即可,点击该书签即可运行代码

代码
- 1.复制网页标题
javascript:(function(){ const el = document.createElement('textarea'); el.value = decodeURIComponent(document.title); document.body.appendChild(el); el.select(); document.execCommand('copy'); document.body.removeChild(el); })();
- 2.复制标题+链接
javascript:(function(){ const el = document.createElement('textarea'); el.value = decodeURIComponent(document.title + '\n' + document.URL); document.body.appendChild(el); el.select(); document.execCommand('copy'); document.body.removeChild(el); })();
- 3.网页夜间模式
javascript:var a=document.createElement('div');a.innerHTML='<div style="position:fixed;background-color:#000;top:0;left:0;z-index:999999;pointer-events:none;opacity:0.35;width:100%;height:100%"></div>';document.body.appendChild(a);
- 4.显示明文密码
javascript:var intput = document.getElementsByTagName('Input');for(var i=0;i<intput.length;i++) {if(intput[i].type.toUpperCase()=='PASSWORD'){intput[i].setAttribute("type","text");}}
- 5.解除网页限制
javascript:"use strict";!function(){var t=function(t){t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation()};["copy","cut","contextmenu","selectstart","mousedown","mouseup","keydown","keypress","keyup"].forEach(function(e){document.documentElement.addEventListener(e,t,{capture:!0})}),alert("解除限制成功啦!")}();
- 6.网页内容编辑
javascript:"use strict";!function(){"true"===document.body.getAttribute("contenteditable")?(document.body.setAttribute("contenteditable",!1),alert("网页不能编辑啦!")):(document.body.setAttribute("contenteditable",!0),alert("网页可以编辑啦!"))}();
- 7.网页分屏
javascript:(function(w,d){var href=location.href;var website=w.prompt('请输入网址','http://')||href;d.write('<HTML><HEAD></HEAD><FRAMESET COLS=\'50%,*\'><FRAME SRC='+location.href+'><FRAME SRC='+website+'></FRAMESET></HTML>');})(window,document)
© 版权声明
本站网络名称:
青鹿云
本站永久网址:
www.milubk.com
网站侵权说明:
本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权请联系站长删除处理。
1 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
2 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
3 本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
1 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
2 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
3 本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
THE END
暂无评论内容