index.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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/!google翻译.js:https://fastly.jsdelivr.net/gh/torappinfo/js1@main/element.js:%0A{let d=document,b=d.body,v=d.createElement('div');v.id='google_translate_element';v.style='position:fixed;bottom:10px;right:10px;cursor:pointer;z-index:9999';b.insertBefore(v,b.firstChild);function googleTranslateElementInit(){new google.translate.TranslateElement({layout:google.translate.TranslateElement.InlineLayout.SIMPLE,multilanguagePage:true,pageLanguage:'auto',includedLanguages:'zh-CN,zh-TW,en,ko,ja'},'google_translate_element');}}">免魔法google翻译</a></p>
  50. <p><a target="_self" href="i:0hbookmarklet/!Google至简体:https://fastly.jsdelivr.net/gh/torappinfo/js1@main/element.js:%0A{let d=document;location.hash=location.hash%2B'#googtrans(zh-CN)';b=d.body;v=d.createElement('div');v.id='google_translate_element';v.style='position:fixed;bottom:10px;right:10px;cursor:pointer;z-index:9999';b.insertBefore(v,b.firstChild);function googleTranslateElementInit(){new google.translate.TranslateElement({layout:google.translate.TranslateElement.InlineLayout.SIMPLE,autoDisplay:true,pageLanguage:'auto',includedLanguages:'zh-CN,zh-TW,en,ko,ja'},'google_translate_element');}}">免魔法Google翻译至简体</a></p>
  51. <p><a target="_self" href="i:0hbookmarklet/!Google至英文:https://fastly.jsdelivr.net/gh/torappinfo/js1@main/element.js:%0A{let d=document;location.hash=location.hash%2B'#googtrans(en)';b=d.body;v=d.createElement('div');v.id='google_translate_element';v.style='position:fixed;bottom:10px;right:10px;cursor:pointer;z-index:9999';b.insertBefore(v,b.firstChild);function googleTranslateElementInit(){new google.translate.TranslateElement({layout:google.translate.TranslateElement.InlineLayout.SIMPLE,autoDisplay:true,pageLanguage:'auto',includedLanguages:'zh-CN,zh-TW,en,ko,ja'},'google_translate_element');}}">免魔法Google翻译至英文</a></p>
  52. <p><a target="_self" href='i:0hbookmarklet/eruda.js:https://fastly.jsdelivr.net/npm/eruda:%0Aeruda.init()'>Eruda</a></p>
  53. <p><a target="_self" href="i:0hbookmarklet/performance.js:https://fastly.jsdelivr.net/gh/micmro/performance-bookmarklet/dist/performanceBookmarklet.min.js">Performance</a><br>
  54. <a target="_self" href="i:0hbookmarklet/移除覆盖物.js:../searchurl/bml/content/rmo.js">移除覆盖物</a></p>
  55. <p><b>远程脚本</b>配置文件default.rjs样列如下,点击以下链接自动安装 (清空后台重启浏览器,长按搜索按钮,则弹出远程脚本菜单):</p>
  56. <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>
  57. <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>
  58. <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>
  59. <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>
  60. <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>
  61. <p><a href="i:04站内搜索:;open('i:15site:' + location.hostname)">站内搜索:;open('i:15site:' + location.hostname)</a></p>
  62. <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>
  63. <p>远程及小型脚本可安装到default.rjs文件中。远程脚本对CSP网站仍然有效。:<br>
  64. <a target="_self" href="i:0gdefault.rjs:../searchurl/txt/rjs.cfg">点击安装背景图等</a></p>
  65. <p>远程脚本配置文件default.rjs每行格式如下 (url部分支持js代码运算):<br>
  66. [远程脚本名]:[返回url数组的javascript代码]</p>
  67. <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>
  68. </div>
  69. <p>Last Modified: 8 April 2024<br>
  70. fix typos<br>
  71. <pre></pre>
  72. </p>
  73. <script id='jsgiscus'
  74. src='https://giscus.app/client.js'
  75. data-repo="torappinfo/uweb"
  76. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  77. data-category="Announcements"
  78. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  79. data-mapping="title"
  80. data-strict="0"
  81. data-reactions-enabled="1"
  82. data-emit-metadata="0"
  83. data-input-position="top"
  84. data-theme="light"
  85. data-lang="en"
  86. data-loading="lazy"
  87. crossorigin="anonymous" async>
  88. </script>
  89. <footer class="site-footer">
  90. <div class="container">
  91. &copy; 2018-2024 Richard H. Cao
  92. </div>
  93. </footer>
  94. <!-- 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/>. -->
  95. </body>
  96. </html>