index.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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="canonical" href="https://jamesfengcao.gitlab.io/uweb/zh/rjs/" />
  7. <link rel="stylesheet" href="../style.css#" type="text/css" />
  8. <title>运行javascript脚本</title>
  9. <script>
  10. function findLang(){
  11. let href = location.href;
  12. for(let i=href.length-1;i>0;i--){
  13. if('/'==href.charAt(i) && '/'==href.charAt(i-3))
  14. return i;
  15. }
  16. return 0;
  17. }
  18. function nav2(page){
  19. let i = findLang();
  20. location.href = location.href.substring(0,i+1)+page;
  21. }
  22. function nav2Lang(lang){
  23. let i = findLang();
  24. let href = location.href;
  25. location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
  26. }
  27. </script>
  28. </head>
  29. <body>
  30. <header class='header'>
  31. <a class="logo" href="javascript:void(0)" onclick="return nav2('index.html#')">首页</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html#')">标签</a>
  32. <a class="logo" href="javascript:void(0)" onclick="return nav2Lang('en')">English</a>
  33. <nav>
  34. </nav>
  35. </header>
  36. <br />
  37. <div class="container">
  38. <h1 class="title">运行javascript脚本
  39. <br>
  40. <span class="subtitle"></span>
  41. </h1>
  42. <ul class="tags">
  43. </ul>
  44. <p><a href="../sitejs/index.html#">特定网址用户脚本</a></p>
  45. <p><b>全局脚本</b>位于js子目录, 长按[☰]按钮配置。点击以下链<br>
  46. 接安装:<br>
  47. <a target="_self" href="i:0hjs/记住密码.js:../searchurl/txt/passwdsave.js">记住密码</a><br>
  48. <a target="_self" href="i:0hjs/极速网页.js:https://fastly.jsdelivr.net/npm/instant.page">极速网页</a></p>
  49. <p><b>大型脚本</b>可安装到&quot;bookmarklet&quot;目录下(长按js按钮):<br>
  50. <a target="_self" href='i:0hbookmarklet/eruda.js:https://fastly.jsdelivr.net/npm/eruda:%0Aeruda.init()'>Eruda</a></p>
  51. <p><a target="_self" href="i:0hbookmarklet/performance.js:https://fastly.jsdelivr.net/gh/micmro/performance-bookmarklet/dist/performanceBookmarklet.min.js">Performance</a><br>
  52. <a target="_self" href="i:0hbookmarklet/移除覆盖物.js:../searchurl/bml/content/rmo.js">移除覆盖物</a></p>
  53. <p><b>远程脚本</b>配置文件default.rjs样列如下,点击以下链接自动安装 (清空后台重启浏览器,长按搜索按钮,则弹出远程脚本菜单):</p>
  54. <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>
  55. <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>
  56. <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>
  57. <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>
  58. <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>
  59. <p><a href="i:04站内搜索:;open('i:15site:' + location.hostname)">站内搜索:;open('i:15site:' + location.hostname)</a></p>
  60. <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>
  61. <p>远程及小型脚本可安装到default.rjs文件中。远程脚本对CSP网站仍然有效。:<br>
  62. <a target="_self" href="i:0gdefault.rjs:../searchurl/txt/rjs.cfg">点击安装背景图等</a></p>
  63. <p>远程脚本配置文件default.rjs每行格式如下 (url部分支持js代码运算):<br>
  64. [远程脚本名]:[返回url数组的javascript代码]</p>
  65. <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>
  66. </div>
  67. <p>Last Modified: 25 October 2024<br>
  68. markdown rjs to use marked<br>
  69. <pre></pre>
  70. </p>
  71. <script id='jsgiscus'
  72. src='https://giscus.app/client.js'
  73. data-repo="torappinfo/uweb"
  74. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  75. data-category="Announcements"
  76. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  77. data-mapping="title"
  78. data-strict="0"
  79. data-reactions-enabled="1"
  80. data-emit-metadata="0"
  81. data-input-position="top"
  82. data-theme="light"
  83. data-lang="en"
  84. data-loading="lazy"
  85. crossorigin="anonymous" async>
  86. </script>
  87. <footer class="site-footer">
  88. <div class="container">
  89. &copy; 2018-2024 Richard H. Cao
  90. </div>
  91. </footer>
  92. <!-- 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/>. -->
  93. </body>
  94. </html>