index.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <link rel="stylesheet" href="../style.css#" type="text/css" />
  7. <title>运行javascript脚本</title>
  8. <script type="text/javascript">
  9. function findLang(){
  10. let href = location.href;
  11. for(let i=href.length-1;i>0;i--){
  12. if('/'==href.charAt(i) && '/'==href.charAt(i-3))
  13. return i;
  14. }
  15. return 0;
  16. }
  17. function nav2(page){
  18. let i = findLang();
  19. location.href = location.href.substring(0,i+1)+page;
  20. }
  21. function nav2Lang(lang){
  22. let i = findLang();
  23. let href = location.href;
  24. location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
  25. }
  26. </script>
  27. </head>
  28. <body>
  29. <header class='header'>
  30. <a class="logo" href="javascript:void(0)" onclick="return nav2('index.html#')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html#')">Tags</a>
  31. <a class="logo" href="javascript:void(0)" onclick="return nav2Lang('en')">English</a>
  32. <nav>
  33. </nav>
  34. </header>
  35. <br />
  36. <div class="container">
  37. <h1 class="title">运行javascript脚本
  38. <br>
  39. <span class="subtitle"></span>
  40. </h1>
  41. <ul class="tags">
  42. </ul>
  43. <p><a href="../sitejs/index.html#">特定网址用户脚本</a></p>
  44. <p><b>全局脚本</b>位于js子目录, 长按[☰]按钮配置。点击以下链<br>
  45. 接安装:<br>
  46. <a target="_self" href="i:0hjs/记住密码.js:../searchurl/txt/passwdsave.js">记住密码</a><br>
  47. <a target="_self" href="i:0hjs/极速网页.js:https://fastly.jsdelivr.net/npm/instant.page">极速网页</a></p>
  48. <p><b>大型脚本</b>可安装到&quot;bookmarklet&quot;目录下(长按js按钮):<br>
  49. <a target="_self" href='i:0hbookmarklet/eruda.js:https://fastly.jsdelivr.net/npm/eruda:%0Aeruda.init()'>Eruda</a></p>
  50. <p><a target="_self" href="i:0hbookmarklet/performance.js:https://fastly.jsdelivr.net/gh/micmro/performance-bookmarklet/dist/performanceBookmarklet.min.js">Performance</a><br>
  51. <a target="_self" href="i:0hbookmarklet/移除覆盖物.js:../searchurl/bml/content/rmo.js">移除覆盖物</a></p>
  52. <p><b>远程脚本</b>配置文件default.rjs样列如下,点击以下链接自动安装 (清空后台重启浏览器,长按搜索按钮,则弹出远程脚本菜单):</p>
  53. <p><a href="i:04Selection to sentence:;let g='sentence';getSelection().modify('move','forward',g);getSelection().modify('extend','backward',g);">Selection to sentence:;let g='sentence';getSelection().modify('move','forward',g);getSelection().modify('extend','backward',g);</a></p>
  54. <p><a href="i:04Selection to line:;let g='line';getSelection().modify('move','forward',g);getSelection().modify('extend','backward',g);">Selection to line:;let g='line';getSelection().modify('move','forward',g);getSelection().modify('extend','backward',g);</a></p>
  55. <p><a href="i:04Selection to paragraph:;let g='paragraph';getSelection().modify('move','forward',g);getSelection().modify('extend','backward',g);">Selection to paragraph:;let g='paragraph';getSelection().modify('move','forward',g);getSelection().modify('extend','backward',g);</a></p>
  56. <p><a href="i:04显示数学公式:['https://fastly.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js']">显示数学公式:['https://fastly.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js']</a></p>
  57. <p><a href="i:04新窗口打开链接:;let d=document;b=d.createElement('base');b.setAttribute('target','_blank');d.head.appendChild(b)">新窗口打开链接:;let d=document;b=d.createElement('base');b.setAttribute('target','_blank');d.head.appendChild(b)</a></p>
  58. <p><a href="i:04站内搜索:;open('i:15site:' + location.hostname)">站内搜索:;open('i:15site:' + location.hostname)</a></p>
  59. <p><a href="i:04编辑器拼写检查:;let t=document.getElementsByTagName('textarea');let v=t[0].spellcheck;if(v==null)v=false;t[0].spellcheck=!v">编辑器拼写检查:;let t=document.getElementsByTagName('textarea');let v=t[0].spellcheck;if(v==null)v=false;t[0].spellcheck=!v</a></p>
  60. <p>远程及小型脚本可安装到default.rjs文件中。远程脚本对CSP网站仍然有效。:<br>
  61. <a target="_self" href="i:0gdefault.rjs:../searchurl/txt/rjs.cfg">点击安装背景图等</a></p>
  62. <p>远程脚本配置文件default.rjs每行格式如下 (url部分支持js代码运算):<br>
  63. [远程脚本名]:[返回url数组的javascript代码]</p>
  64. <p>其中url可以为本地http脚本地址。譬如'https://local/...' (<a href="../html5/index.html#">本地html5应用</a>或<a href="../offlinecache/index.html#">离线缓存</a>)。此时,js脚本也可使用<a href="../links/index.html#">.link文件</a>方式调用。</p>
  65. </div>
  66. <p>Last Modified: 13 June 2024<br>
  67. markdown rjs to use marked<br>
  68. <pre></pre>
  69. </p>
  70. <script id='jsgiscus'
  71. src='https://giscus.app/client.js'
  72. data-repo="torappinfo/uweb"
  73. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  74. data-category="Announcements"
  75. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  76. data-mapping="title"
  77. data-strict="0"
  78. data-reactions-enabled="1"
  79. data-emit-metadata="0"
  80. data-input-position="top"
  81. data-theme="light"
  82. data-lang="en"
  83. data-loading="lazy"
  84. crossorigin="anonymous" async>
  85. </script>
  86. <footer class="site-footer">
  87. <div class="container">
  88. &copy; 2018-2024 Richard H. Cao
  89. </div>
  90. </footer>
  91. <!-- This document is licensed under the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at <https://www.gnu.org/licenses/>. -->
  92. </body>
  93. </html>