index.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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/adblock_domain/" />
  7. <link rel="stylesheet" href="../style.css#" type="text/css" />
  8. <title>绝杀完整域名树</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">绝杀完整域名树
  39. <br>
  40. <span class="subtitle"></span>
  41. </h1>
  42. <ul class="tags">
  43. <li><a href="../tags/%e4%b8%8d%e8%89%af%e4%bf%a1%e6%81%af%e5%b1%8f%e8%94%bd/index.html#">不良信息屏蔽</a> </li>
  44. </ul>
  45. <p><a href="file:///data/data/info.torapp.uweb/files/default.hosts">域名文件</a>可屏蔽文件中域名的一切子域名、孙域名、......,可彻底绝杀一切不良信息。所以用户屏蔽根域名时无需选择提示中出现的整个域名,<span style="color:red">只需选取最后两段或三段</span>(最后两段不超过6字符如com.cn的域名可取四段)。</p>
  46. <ul>
  47. <li>
  48. <p>可使用<a href="../bookmarklet/index.html#">列出外部脚本小书签</a>生成外部js文件列表,然后长按底部工具栏&quot;js&quot;按钮,执行&quot;网址转链接&quot;菜单命令,长按可疑链接(一般为域名不同的外链),执行“屏蔽根域名”。</p>
  49. </li>
  50. <li>
  51. <p>长按不良信息链接,点击“图片:屏蔽根域名”,修改弹出域名,一般取最后两段,点击&quot;确定&quot;屏蔽当前图片网址。</p>
  52. </li>
  53. <li>
  54. <p>部分不良信息没有链接可长按,或虽有链接但长按时不出现图片相关菜单。此时可长按[JS]点击&quot;背景图片&quot;或&quot;看图模式&quot;,再长按不良信息链接点击“图片:屏蔽根域名”,屏蔽图片网址。</p>
  55. </li>
  56. <li>
  57. <p>可长按设置开启&quot;资源嗅探&quot;,推荐设置文件&quot;types.sniff&quot;内容为js,刷新网页后关闭&quot;资源嗅探&quot;选项。在弹出的资源网页上长按链接,屏蔽根域名。</p>
  58. </li>
  59. <li>
  60. <p>(可选) 长按不良信息链接,点击“屏蔽根域名”,屏蔽链接网址。</p>
  61. </li>
  62. <li>
  63. <p>(可选) 某些不良信息靠javascript激发,链接中不出现域名,可点击激发至新网址后将新网址根域名屏蔽。</p>
  64. </li>
  65. <li>
  66. <p>支持域名及整个网址正则表达式<br>
  67. 文件格式每行如下:<br>
  68. 根域名[空格]域名前缀正则表达式[空格]整个网址去掉协议部分后正则表达式<br>
  69. 空格及后面两个正则表达式为可选择项。正则表达式采用java标准。<br>
  70. 如果用到了第二个正则表达式,此时将域名前缀表达式合并到第二个正则表达式中,从而仅使用一个表达式可优化性能。</p>
  71. </li>
  72. </ul>
  73. <p><a target="_self" href="i:0hdefault.hosts:../searchurl/default.hosts">点击本链接自动用样例覆盖default.hosts</a></p>
  74. </div>
  75. <p>Last Modified: 2 April 2024<br>
  76. add js function in README<br>
  77. <pre></pre>
  78. </p>
  79. <script id='jsgiscus'
  80. src='https://giscus.app/client.js'
  81. data-repo="torappinfo/uweb"
  82. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  83. data-category="Announcements"
  84. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  85. data-mapping="title"
  86. data-strict="0"
  87. data-reactions-enabled="1"
  88. data-emit-metadata="0"
  89. data-input-position="top"
  90. data-theme="light"
  91. data-lang="en"
  92. data-loading="lazy"
  93. crossorigin="anonymous" async>
  94. </script>
  95. <footer class="site-footer">
  96. <div class="container">
  97. &copy; 2018-2024 Richard H. Cao
  98. </div>
  99. </footer>
  100. <!-- 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/>. -->
  101. </body>
  102. </html>