希望把JS代码保存为书签,点击后实现JS功能。如:把下面代码保存为书签,实现附件里图片效果。谢谢!
javascript:(function(){window._jumpName=function(_na){window.open("https://www.baidu.com/s?wd="+document.g ... me").value);_close()};window._close=function(){var d=document.getElementById("_j");if(d){d.remove();return true}};if(_close()){return};var _co1=getSelection().toString();var _code=`<div id="_j"style="position: fixed;background-color: #f1fff7;text-align: center;z-index: 99999;top: 0px;left: 24%;right: 24%;border-radius: 0px 0px 30px 30px;padding: 14px;box-shadow: 0px 0px 8px 3px #4279ff;"><h4 style="margin-bottom:15px;"><a target="_blank"href="https://www.baidu.com/">百度-首页</a></h4><h4 </h4><div><input style="font-size:17px;padding:4px;width:40%;"type="text"placeholder="请输入内容"id="_Name"/><button style="font-size:17px;padding:4px;margin-left:3px;"onclick="_jumpName();">百度</button><button style="font-size:17px;padding:4px;margin-left:3px;"onclick="_close();">关闭</button></div><br/></div>%60;_code=_code.replace("_u_",location.href).replace("*t",Date.parse(new Date())).replace(/_c_/g,_co1);if(_co1){_code=_code.replace("none","")}document.body.insertAdjacentHTML("afterbegin",_code)})();
catsxp浏览器不能在书签栏实现JS功能
catsxp浏览器不能在书签栏实现JS功能
- 附件
-
- QQ图片20230829104729.png (48.99 KiB) 查看 5769 次
上次由 mbz 在 2023年 8月 31日 15:03,总共编辑 1 次。
Re: catsxp浏览器不能在书签栏实现JS功能
希望+1
解除页面限制
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("解除限制成功啦!")}();
显示密码
javascript:"use strict";!function(){var e,t;e=document.getElementsByTagName("input");for(var a=0;a<e.length;a++)if(t=e[a],"password"==t.type.toLowerCase())try{t.type="text"}catch(e){var r,n;r=document.createElement("input"),n=t.attributes;for(var o=0;o<n.length;o++){var i,c,d;i=n[o],c=i.nodeName,d=i.nodeValue,"type"!=c.toLowerCase()&&"height"!=c&&"width"!=c&!!d&&(r[c]=d)}t.parentNode.replaceChild(r,t)}}();
的这类功能 用扩展实现太不灵活了 规则不好设定 用书签 点击就用最方便了
上次由 hihi427 在 2023年 8月 30日 17:40,总共编辑 1 次。
Re: catsxp浏览器不能在书签栏实现JS功能
新版已添加 js书签 功能mbz 写了: 2023年 8月 29日 10:56 希望把JS代码保存为书签,点击后实现JS功能。如:把下面代码保存为书签,实现附件里图片效果。谢谢!
javascript:(function(){window._jumpName=function(_na){window.open("https://www.baidu.com/s?wd=?id="+docume ... me").value);_close()};window._close=function(){var d=document.getElementById("_j");if(d){d.remove();return true}};if(_close()){return};var _co1=getSelection().toString();var _code=`<div id="_j"style="position: fixed;background-color: #f1fff7;text-align: center;z-index: 99999;top: 0px;left: 24%;right: 24%;border-radius: 0px 0px 30px 30px;padding: 14px;box-shadow: 0px 0px 8px 3px #4279ff;"><h4 style="margin-bottom:15px;"><a target="_blank"href="https://www.baidu.com/s?wd=">百度-首页</a></h4><h4 style="margin-bottom:15px;"><a target="_blank"href="https://www.baidu.com/s?wd=?id=_u_&t=*t"></a></h4><h4 style="display:none;margin-bottom:15px;"><a id="_cid"target="_blank"href="https://www.baidu.com/s?ie=UTF-8&wd=_">搜索:<span style="color:red;">_c_</span></a></h4><div><input style="font-size:17px;padding:4px;width:40%;"type="text"placeholder=""id="_videoName"/><button style="font-size:17px;padding:4px;margin-left:3px;"onclick="_jumpName();">百度</button><button style="font-size:17px;padding:4px;margin-left:3px;"onclick="_close();">关闭</button></div><br/></div>%60;_code=_code.replace("_u_",location.href).replace("*t",Date.parse(new Date())).replace(/_c_/g,_co1);if(_co1){_code=_code.replace("none","")}document.body.insertAdjacentHTML("afterbegin",_code)})();
测试了跟帖的 js书签 可以正常,但主楼上的js 执行没效果...
Re: catsxp浏览器不能在书签栏实现JS功能
主楼js代码没问题?代码完整性?
执行无效,其它的JS代码能正常执行!
Re: catsxp浏览器不能在书签栏实现JS功能
百度JS完整代码:
javascript:(function(){window._jumpName=function(_na){window.open("https://www.baidu.com/s?wd="+document.g ... me").value);_close()};window._close=function(){var d=document.getElementById("_j");if(d){d.remove();return true}};if(_close()){return};var _co1=getSelection().toString();var _code=`<div id="_j"style="position: fixed;background-color: #f1fff7;text-align: center;z-index: 99999;top: 0px;left: 24%;right: 24%;border-radius: 0px 0px 30px 30px;padding: 14px;box-shadow: 0px 0px 8px 3px #4279ff;"><h4 style="margin-bottom:15px;"><a target="_blank"href="https://www.baidu.com/">百度-首页</a></h4><h4 </h4><div><input style="font-size:17px;padding:4px;width:40%;"type="text"placeholder="请输入内容"id="_Name"/><button style="font-size:17px;padding:4px;margin-left:3px;"onclick="_jumpName();">百度</button><button style="font-size:17px;padding:4px;margin-left:3px;"onclick="_close();">关闭</button></div><br/></div>%60;_code=_code.replace("_u_",location.href).replace("*t",Date.parse(new Date())).replace(/_c_/g,_co1);if(_co1){_code=_code.replace("none","")}document.body.insertAdjacentHTML("afterbegin",_code)})();
javascript:(function(){window._jumpName=function(_na){window.open("https://www.baidu.com/s?wd="+document.g ... me").value);_close()};window._close=function(){var d=document.getElementById("_j");if(d){d.remove();return true}};if(_close()){return};var _co1=getSelection().toString();var _code=`<div id="_j"style="position: fixed;background-color: #f1fff7;text-align: center;z-index: 99999;top: 0px;left: 24%;right: 24%;border-radius: 0px 0px 30px 30px;padding: 14px;box-shadow: 0px 0px 8px 3px #4279ff;"><h4 style="margin-bottom:15px;"><a target="_blank"href="https://www.baidu.com/">百度-首页</a></h4><h4 </h4><div><input style="font-size:17px;padding:4px;width:40%;"type="text"placeholder="请输入内容"id="_Name"/><button style="font-size:17px;padding:4px;margin-left:3px;"onclick="_jumpName();">百度</button><button style="font-size:17px;padding:4px;margin-left:3px;"onclick="_close();">关闭</button></div><br/></div>%60;_code=_code.replace("_u_",location.href).replace("*t",Date.parse(new Date())).replace(/_c_/g,_co1);if(_co1){_code=_code.replace("none","")}document.body.insertAdjacentHTML("afterbegin",_code)})();
Re: catsxp浏览器不能在书签栏实现JS功能
测试还是无效!!mbz 写了: 2023年 8月 31日 15:02 百度JS完整代码:
javascript:(function(){window._jumpName=function(_na){window.open("https://www.baidu.com/s?wd="+document.g ... me").value);_close()};window._close=function(){var d=document.getElementById("_j");if(d){d.remove();return true}};if(_close()){return};var _co1=getSelection().toString();var _code=`<div id="_j"style="position: fixed;background-color: #f1fff7;text-align: center;z-index: 99999;top: 0px;left: 24%;right: 24%;border-radius: 0px 0px 30px 30px;padding: 14px;box-shadow: 0px 0px 8px 3px #4279ff;"><h4 style="margin-bottom:15px;"><a target="_blank"href="https://www.baidu.com/">百度-首页</a></h4><h4 </h4><div><input style="font-size:17px;padding:4px;width:40%;"type="text"placeholder="请输入内容"id="_Name"/><button style="font-size:17px;padding:4px;margin-left:3px;"onclick="_jumpName();">百度</button><button style="font-size:17px;padding:4px;margin-left:3px;"onclick="_close();">关闭</button></div><br/></div>%60;_code=_code.replace("_u_",location.href).replace("*t",Date.parse(new Date())).replace(/_c_/g,_co1);if(_co1){_code=_code.replace("none","")}document.body.insertAdjacentHTML("afterbegin",_code)})();
用txt保存 然后上传附件,这个js我测试不过通过!不确认新增功能是否正常!
Re: catsxp浏览器不能在书签栏实现JS功能
百分再次测试没有问题呢!
。
附件代码TXT上传失败,提示无效的文件扩展名 

