uweb/en/adblock_domain/index.html

72 lines
2.9 KiB
HTML
Raw Normal View History

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="../style.css" type="text/css" />
2023-03-20 14:31:36 +00:00
<title>Hosts files</title>
<script type="text/javascript">
function findLang(){
let href = location.href;
for(let i=href.length-1;i>0;i--){
if('/'==href.charAt(i) && '/'==href.charAt(i-3))
return i;
}
return 0;
}
function nav2(page){
let i = findLang();
location.href = location.href.substring(0,i+1)+page;
}
function nav2Lang(lang){
let i = findLang();
let href = location.href;
location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
}
</script>
</head>
<body>
<header class='header'>
<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>
<a class="logo" href="javascript:void(0)" onclick="return nav2Lang('zh')">简体中文</a>
<nav>
</nav>
</header>
<br />
<div class="container">
2023-03-20 14:31:36 +00:00
<h1 class="title">Hosts files
<br>
<span class="subtitle"></span>
</h1>
<ul class="tags">
<li><a href="../tags/adblock">adblock</a> </li>
</ul>
2023-03-20 14:31:36 +00:00
<p>The hosts files &quot;hosts&quot; and &quot;default.hosts&quot; take effect when the setting option &quot;using hosts&quot; is checked.</p>
<p>The file <a href="file:///data/data/info.torapp.uweb/files/hosts">&quot;hosts&quot;</a> defines IP addresses for domains. Each line has the following format:<br>
[IP address][single space][domain name]</p>
2023-04-01 07:15:10 +00:00
<p>Here is an example line with ipv4:<br>
172.67.157.211 torapp.eu.org</p>
<p>or with ipv6:<br>
[2606:4700:3037::6815:8c3] torapp.eu.org</p>
2023-03-20 14:31:36 +00:00
<p><a href="file:///data/data/info.torapp.uweb/files/default.hosts">&quot;default.hosts&quot;</a> blocks whole domain trees including all descedant domains. The domains in the hosts file must be 2 or 3 segment domains, such as &quot;yahoo.com&quot; and &quot;finance.yahoo.com&quot;. If the length of the last 2 segments is less than 7, such as &quot;com.pl&quot;, then it is treated as one segment, so domains like &quot;xxx.xxx.com.pl&quot; are also valid in the hosts file.</p>
<p>Each line of the hosts file has the following format:<br>
[rootDomain][space][regex for domain prefix before rootDomain][space][regex for the whole url without &quot;http(s)://&quot;]<br>
The first part [rootDomain] is required and the others are optional. regex is java-grammar regular expression. If the second regex is used, it is recommended to merge the first regex to the second one for performance.</p>
</div>
2023-04-01 07:15:10 +00:00
<p>Last Modified: 1 April 2023<br>
use [ipv6] in hosts<br>
2023-03-07 02:07:05 +00:00
<pre></pre>
</p>
</body>
</html>