index.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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/en/adblock/" />
  7. <link rel="stylesheet" href="../style.css#" type="text/css" />
  8. <title>AD blocking</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#')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html#')">Tags</a>
  32. <a class="logo" href="javascript:void(0)" onclick="return nav2Lang('zh')">简体中文</a>
  33. <nav>
  34. </nav>
  35. </header>
  36. <br />
  37. <div class="container">
  38. <h1 class="title">AD blocking
  39. <br>
  40. <span class="subtitle"></span>
  41. </h1>
  42. <ul class="tags">
  43. </ul>
  44. <ul>
  45. <li>
  46. <p><a href="../adblock_domain/index.html#">Host blocking</a>。</p>
  47. <ul>
  48. <li>Use <a href="../bookmarklet/index.html#">bookmarklet &quot;list all script urls&quot;</a> to generate url links, long pressing dubious script (usually 3rd-party library) link, click &quot;Block domain root&quot;.</li>
  49. </ul>
  50. </li>
  51. <li>
  52. <p><a href="../sitejs/index.html#">Javascript and CSS for domains</a>。</p>
  53. <ul>
  54. <li>Long press the button &quot;js&quot;, click the menu &quot;MarkAD mode&quot;. In &quot;markAD mode&quot;, click page element to show all attributes and generate CSS AD blocking styles. By default, &quot;display:none&quot; is used. If &quot;display&quot; appears in the attribute information, recommend to use &quot;transform:scale(0)!important&quot; instead.</li>
  55. </ul>
  56. </li>
  57. <li>
  58. <p>Long press the tab manager button, check &quot;Videos only&quot; for video sites and &quot;Images only&quot; for image sites. Other AD blocking options are &quot;Hide pseudo elements&quot; and &quot;Hide iframes&quot;.</p>
  59. <ul>
  60. <li>Add prefix &quot;i:0mc32:&quot; to url when bookmarking, then the option &quot;Images only&quot; applies to whole url subtree. Similarly, &quot;c16&quot; for the option &quot;Videos only&quot; and &quot;c12&quot; for hiding both pseudo elements and iframes.</li>
  61. <li>Long press the button [☰], check the option &quot;Fullscreen autoplay&quot;. Videos are autoplayed in fullscreen mode, ADs have no chance to appear.</li>
  62. </ul>
  63. </li>
  64. <li>
  65. <p>Long press the setting button, check the option &quot;Block external scripts&quot;. <a href="i:61:../searchurl/func.html">UI</a> website has option to also block dubious 3rd party resources. <a href="file:///data/data/info.torapp.uweb/files/js.allow">js.allow</a> whitelists js libraries.</p>
  66. </li>
  67. <li>
  68. <p>Long press the button [☰], &quot;Disable floating ADs&quot;, &quot;Disable banners&quot;, &quot;clear all timers&quot;, &quot;stop events&quot; and &quot;Sleep ...&quot; are also available.</p>
  69. </li>
  70. <li>
  71. <p>Click the button with image icon to hide all images.</p>
  72. </li>
  73. <li>
  74. <p>Click the button &quot;JS&quot; to disable javascript.</p>
  75. </li>
  76. <li>
  77. <p><a href="file:///data/data/info.torapp.uweb/files/url.deny">url.deny</a>: one giant regular expression for blocked urls (java grammar), in which carriage returns (CR or newline) are ignored and &quot;#&quot; is for comments.</p>
  78. </li>
  79. </ul>
  80. </div>
  81. <p>Last Modified: 2 April 2024<br>
  82. add js function in README<br>
  83. <pre></pre>
  84. </p>
  85. <script id='jsgiscus'
  86. src='https://giscus.app/client.js'
  87. data-repo="torappinfo/uweb"
  88. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  89. data-category="Announcements"
  90. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  91. data-mapping="title"
  92. data-strict="0"
  93. data-reactions-enabled="1"
  94. data-emit-metadata="0"
  95. data-input-position="top"
  96. data-theme="light"
  97. data-lang="en"
  98. data-loading="lazy"
  99. crossorigin="anonymous" async>
  100. </script>
  101. <footer class="site-footer">
  102. <div class="container">
  103. &copy; 2018-2024 Richard H. Cao
  104. </div>
  105. </footer>
  106. <!-- 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/>. -->
  107. </body>
  108. </html>