mirror of
https://github.com/torappinfo/uweb.git
synced 2024-08-14 23:54:59 +00:00
Compare commits
4 commits
9ea6258d40
...
6a726e893c
Author | SHA1 | Date | |
---|---|---|---|
|
6a726e893c | ||
|
441db3a1f4 | ||
|
95c5410f00 | ||
|
e8b5f412f0 |
13 changed files with 89 additions and 32 deletions
|
@ -48,8 +48,8 @@ Long pressing the bookmark button in uweb browser will popup menus defined in fi
|
||||||
<guid>/en/adblock_domain/</guid>
|
<guid>/en/adblock_domain/</guid>
|
||||||
<description>The enhanced hosts files &quot;hosts&quot; and &quot;default.hosts&quot; take effect when the setting option &quot;using hosts&quot; is checked.
|
<description>The enhanced hosts files &quot;hosts&quot; and &quot;default.hosts&quot; take effect when the setting option &quot;using hosts&quot; is checked.
|
||||||
The enhanced file &quot;hosts&quot; defines IP addresses/attributes for domains. Each line has the following format:
|
The enhanced file &quot;hosts&quot; defines IP addresses/attributes for domains. Each line has the following format:
|
||||||
[IP address/attributes][single space][domain name]
|
[[IP address][attributes]][single space][domain name]
|
||||||
where &quot;[IP address/attributes]&quot; could be:
|
where &quot;[[IP address][attributes]]&quot; could be:
|
||||||
ipv4 address such as:
|
ipv4 address such as:
|
||||||
172.67.157.211 torapp.eu.org
|
172.67.157.211 torapp.eu.org
|
||||||
ipv6 address, Ex.:
|
ipv6 address, Ex.:
|
||||||
|
|
|
@ -51,8 +51,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
<p>The enhanced hosts files "hosts" and "default.hosts" take effect when the setting option "using hosts" is checked.</p>
|
<p>The enhanced hosts files "hosts" and "default.hosts" take effect when the setting option "using hosts" is checked.</p>
|
||||||
<p>The <span style="color:red">enhanced</span> file <a href="file:///data/data/info.torapp.uweb/files/hosts">"hosts"</a> defines IP addresses/attributes for domains. Each line has the following format:<br>
|
<p>The <span style="color:red">enhanced</span> file <a href="file:///data/data/info.torapp.uweb/files/hosts">"hosts"</a> defines IP addresses/attributes for domains. Each line has the following format:<br>
|
||||||
[IP address/attributes][single space][domain name]</p>
|
[[IP address][attributes]][single space][domain name]</p>
|
||||||
<p>where "[IP address/attributes]" could be:</p>
|
<p>where "[[IP address][attributes]]" could be:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<p>ipv4 address such as:<br>
|
<p>ipv4 address such as:<br>
|
||||||
|
@ -65,22 +65,26 @@
|
||||||
<li>
|
<li>
|
||||||
<p>empty, that would lift all server-imposed limitations. Ex.:<br>
|
<p>empty, that would lift all server-imposed limitations. Ex.:<br>
|
||||||
[single space]gitee.com</p>
|
[single space]gitee.com</p>
|
||||||
|
<p>which will make all git repositories on the domain visitable as websites with raw file access url.</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>response headers, separeded by ';', Ex.:<br>
|
||||||
|
Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true mybing.xn--xyza.top</p>
|
||||||
|
<p>which makes "mybing2.xn--xyza.top" to accept CORS requests with cookies.</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>IP address and response headers, separeded by ';', Ex.:<br>
|
||||||
|
104.21.8.195;Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true uweb.torapp.eu.org</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>which will make all git repositories on the domain visitable as websites with raw file access url.</p>
|
|
||||||
<ul>
|
|
||||||
<li>response headers, separeded by ';', Ex.:<br>
|
|
||||||
Access-Control-Allow-Origin;*;Access-Control-Allow-Credentials;true mybing2.xn--xyza.top</li>
|
|
||||||
</ul>
|
|
||||||
<p>which makes "mybing2.xn--xyza.top" to accept CORS requests with cookies.</p>
|
|
||||||
<p><a href="file:///data/data/info.torapp.uweb/files/default.hosts">"default.hosts"</a> blocks whole domain trees including all descedant domains. The domains in the hosts file must be 2 or 3 segment domains, such as "yahoo.com" and "finance.yahoo.com". If the length of the last 2 segments is less than 7, such as "com.pl", then it is treated as one segment, so domains like "xxx.xxx.com.pl" are also valid in the hosts file.</p>
|
<p><a href="file:///data/data/info.torapp.uweb/files/default.hosts">"default.hosts"</a> blocks whole domain trees including all descedant domains. The domains in the hosts file must be 2 or 3 segment domains, such as "yahoo.com" and "finance.yahoo.com". If the length of the last 2 segments is less than 7, such as "com.pl", then it is treated as one segment, so domains like "xxx.xxx.com.pl" are also valid in the hosts file.</p>
|
||||||
<p>Each line of the hosts file has the following format:<br>
|
<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 "http(s)://"]<br>
|
[rootDomain][space][regex for domain prefix before rootDomain][space][regex for the whole url without "http(s)://"]<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>
|
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>
|
</div>
|
||||||
<p>Last Modified: 3 April 2023<br>
|
<p>Last Modified: 7 April 2023<br>
|
||||||
bingAI to support cors with cookies<br>
|
add bing.js for cf & deno<br>
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,8 @@ Long pressing the bookmark button in uweb browser will popup menus defined in fi
|
||||||
<guid>/en/adblock_domain/</guid>
|
<guid>/en/adblock_domain/</guid>
|
||||||
<description>The enhanced hosts files &quot;hosts&quot; and &quot;default.hosts&quot; take effect when the setting option &quot;using hosts&quot; is checked.
|
<description>The enhanced hosts files &quot;hosts&quot; and &quot;default.hosts&quot; take effect when the setting option &quot;using hosts&quot; is checked.
|
||||||
The enhanced file &quot;hosts&quot; defines IP addresses/attributes for domains. Each line has the following format:
|
The enhanced file &quot;hosts&quot; defines IP addresses/attributes for domains. Each line has the following format:
|
||||||
[IP address/attributes][single space][domain name]
|
[[IP address][attributes]][single space][domain name]
|
||||||
where &quot;[IP address/attributes]&quot; could be:
|
where &quot;[[IP address][attributes]]&quot; could be:
|
||||||
ipv4 address such as:
|
ipv4 address such as:
|
||||||
172.67.157.211 torapp.eu.org
|
172.67.157.211 torapp.eu.org
|
||||||
ipv6 address, Ex.:
|
ipv6 address, Ex.:
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
async function getMagicUrl() {
|
async function getMagicUrl() {
|
||||||
let v = localStorage.GoGoUrl;
|
let v = localStorage.GoGoUrl;
|
||||||
if(v) return v;
|
if(v) return v;
|
||||||
return "https://muweb.us.to/";
|
return "https://mybing2.xn--xyza.top/";
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="./js/GetSet.js"></script>
|
<script type="text/javascript" src="./js/GetSet.js"></script>
|
||||||
|
|
29
en/searchurl/cloudflare/bing.js
Normal file
29
en/searchurl/cloudflare/bing.js
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
export default {
|
||||||
|
async fetch(req, _env) {
|
||||||
|
let url = req.url;
|
||||||
|
let iSlash = url.indexOf('/',11);
|
||||||
|
let nUrl = "https://www.bing.com/"+url.substring(iSlash+1);
|
||||||
|
return goUrl(req, nUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function goUrl(request, url) {
|
||||||
|
//构建 fetch 参数
|
||||||
|
let fp = {
|
||||||
|
method: request.method,
|
||||||
|
headers: {}
|
||||||
|
}
|
||||||
|
//保留头部信息
|
||||||
|
let reqHeaders = new Headers(request.headers);
|
||||||
|
let dropHeaders = ["cookie","user-agent","accept","accept-language"];
|
||||||
|
let he = reqHeaders.entries();
|
||||||
|
for (let h of he) {
|
||||||
|
let key = h[0],
|
||||||
|
value = h[1];
|
||||||
|
if (dropHeaders.includes(key)) {
|
||||||
|
fp.headers[key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fetch(url, fp);
|
||||||
|
}
|
||||||
|
|
24
en/searchurl/deno/bing.js
Normal file
24
en/searchurl/deno/bing.js
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import { serve } from "https://deno.land/std@0.140.0/http/server.ts";
|
||||||
|
async function handler(req: Request): Promise<Response> {
|
||||||
|
let url = req.url;
|
||||||
|
let iSlash = url.indexOf('/',11);
|
||||||
|
let nUrl = "https://www.bing.com/"+url.substring(iSlash+1);
|
||||||
|
let fp = {
|
||||||
|
method: req.method,
|
||||||
|
headers: {}
|
||||||
|
}
|
||||||
|
let reqHeaders = new Headers(req.headers);
|
||||||
|
let keepHeaders = ["cookie","user-agent","accept","accept-language"];
|
||||||
|
let he = reqHeaders.entries();
|
||||||
|
for (let h of he) {
|
||||||
|
let key = h[0],
|
||||||
|
value = h[1];
|
||||||
|
if (keepHeaders.includes(key)) {
|
||||||
|
fp.headers[key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return await fetch(nUrl, fp);
|
||||||
|
}
|
||||||
|
|
||||||
|
serve(handler);
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||||
<url>
|
<url>
|
||||||
<loc>/en/_posts/</loc>
|
<loc>/en/_posts/</loc>
|
||||||
<lastmod>2023-04-03T17:48:42+08:00</lastmod>
|
<lastmod>2023-04-07T18:05:06+08:00</lastmod>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="zh"
|
hreflang="zh"
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
/>
|
/>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>/en/</loc>
|
<loc>/en/</loc>
|
||||||
<lastmod>2023-04-03T17:49:38+08:00</lastmod>
|
<lastmod>2023-04-07T18:05:06+08:00</lastmod>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="zh"
|
hreflang="zh"
|
||||||
|
@ -55,10 +55,10 @@
|
||||||
/>
|
/>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>/en/tags/adblock/</loc>
|
<loc>/en/tags/adblock/</loc>
|
||||||
<lastmod>2023-04-03T17:48:42+08:00</lastmod>
|
<lastmod>2023-04-07T18:05:06+08:00</lastmod>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>/en/adblock_domain/</loc>
|
<loc>/en/adblock_domain/</loc>
|
||||||
<lastmod>2023-04-03T17:48:42+08:00</lastmod>
|
<lastmod>2023-04-07T18:05:06+08:00</lastmod>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="zh"
|
hreflang="zh"
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
/>
|
/>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>/en/tags/</loc>
|
<loc>/en/tags/</loc>
|
||||||
<lastmod>2023-04-03T17:48:42+08:00</lastmod>
|
<lastmod>2023-04-07T18:05:06+08:00</lastmod>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="zh"
|
hreflang="zh"
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
<guid>/en/adblock_domain/</guid>
|
<guid>/en/adblock_domain/</guid>
|
||||||
<description>The enhanced hosts files &quot;hosts&quot; and &quot;default.hosts&quot; take effect when the setting option &quot;using hosts&quot; is checked.
|
<description>The enhanced hosts files &quot;hosts&quot; and &quot;default.hosts&quot; take effect when the setting option &quot;using hosts&quot; is checked.
|
||||||
The enhanced file &quot;hosts&quot; defines IP addresses/attributes for domains. Each line has the following format:
|
The enhanced file &quot;hosts&quot; defines IP addresses/attributes for domains. Each line has the following format:
|
||||||
[IP address/attributes][single space][domain name]
|
[[IP address][attributes]][single space][domain name]
|
||||||
where &quot;[IP address/attributes]&quot; could be:
|
where &quot;[[IP address][attributes]]&quot; could be:
|
||||||
ipv4 address such as:
|
ipv4 address such as:
|
||||||
172.67.157.211 torapp.eu.org
|
172.67.157.211 torapp.eu.org
|
||||||
ipv6 address, Ex.:
|
ipv6 address, Ex.:
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
<sitemap>
|
<sitemap>
|
||||||
<loc>en/sitemap.xml</loc>
|
<loc>en/sitemap.xml</loc>
|
||||||
|
|
||||||
<lastmod>2023-04-03T17:49:38+08:00</lastmod>
|
<lastmod>2023-04-07T18:05:06+08:00</lastmod>
|
||||||
|
|
||||||
</sitemap>
|
</sitemap>
|
||||||
|
|
||||||
<sitemap>
|
<sitemap>
|
||||||
<loc>zh/sitemap.xml</loc>
|
<loc>zh/sitemap.xml</loc>
|
||||||
|
|
||||||
<lastmod>2023-04-06T09:03:54+08:00</lastmod>
|
<lastmod>2023-04-07T14:38:07+08:00</lastmod>
|
||||||
|
|
||||||
</sitemap>
|
</sitemap>
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
复制bing.com cookies至魔法域名
|
复制bing.com cookies至魔法域名
|
||||||
勾选选项“使用离线缓存”, &quot;使用hosts&quot;
|
勾选选项“使用离线缓存”, &quot;使用hosts&quot;
|
||||||
hosts文件内添加一行(允许发送cookie至魔法url):
|
hosts文件内添加一行(允许发送cookie至魔法url):
|
||||||
Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true muweb.us.to
|
Click to append to &quot;hosts&quot;, edit the last part as magic url domain
|
||||||
点击界面入口
|
点击界面入口
|
||||||
可配置魔法url, 上述hosts文件作相应修改, 复制bing.com cookies至魔法域名。 详情
|
可配置魔法url, 上述hosts文件作相应修改, 复制bing.com cookies至魔法域名。 详情
|
||||||
方法2: 可以采用超级书签/直接界面+脚本+hosts。
|
方法2: 可以采用超级书签/直接界面+脚本+hosts。
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
复制bing.com cookies至魔法域名
|
复制bing.com cookies至魔法域名
|
||||||
勾选选项“使用离线缓存”, &quot;使用hosts&quot;
|
勾选选项“使用离线缓存”, &quot;使用hosts&quot;
|
||||||
hosts文件内添加一行(允许发送cookie至魔法url):
|
hosts文件内添加一行(允许发送cookie至魔法url):
|
||||||
Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true muweb.us.to
|
Click to append to &quot;hosts&quot;, edit the last part as magic url domain
|
||||||
点击界面入口
|
点击界面入口
|
||||||
可配置魔法url, 上述hosts文件作相应修改, 复制bing.com cookies至魔法域名。 详情
|
可配置魔法url, 上述hosts文件作相应修改, 复制bing.com cookies至魔法域名。 详情
|
||||||
方法2: 可以采用超级书签/直接界面+脚本+hosts。
|
方法2: 可以采用超级书签/直接界面+脚本+hosts。
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||||
<url>
|
<url>
|
||||||
<loc>/zh/_posts/</loc>
|
<loc>/zh/_posts/</loc>
|
||||||
<lastmod>2023-04-06T09:03:54+08:00</lastmod>
|
<lastmod>2023-04-07T14:38:07+08:00</lastmod>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="en"
|
hreflang="en"
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
/>
|
/>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>/zh/</loc>
|
<loc>/zh/</loc>
|
||||||
<lastmod>2023-04-06T09:03:54+08:00</lastmod>
|
<lastmod>2023-04-07T14:38:07+08:00</lastmod>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="en"
|
hreflang="en"
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
/>
|
/>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>/zh/tips/</loc>
|
<loc>/zh/tips/</loc>
|
||||||
<lastmod>2023-04-06T09:03:54+08:00</lastmod>
|
<lastmod>2023-04-07T14:38:07+08:00</lastmod>
|
||||||
<xhtml:link
|
<xhtml:link
|
||||||
rel="alternate"
|
rel="alternate"
|
||||||
hreflang="en"
|
hreflang="en"
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
复制bing.com cookies至魔法域名<br>
|
复制bing.com cookies至魔法域名<br>
|
||||||
勾选选项“使用离线缓存”, "使用hosts"</p>
|
勾选选项“使用离线缓存”, "使用hosts"</p>
|
||||||
<p>hosts文件内添加一行(允许发送cookie至魔法url):<br>
|
<p>hosts文件内添加一行(允许发送cookie至魔法url):<br>
|
||||||
Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true muweb.us.to</p>
|
<a href="i:0ghosts::Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true mybing2.xn--xyza.top%0A">Click to append to "hosts", edit the last part as magic url domain</a></p>
|
||||||
<p>点击界面入口<br>
|
<p>点击界面入口<br>
|
||||||
可配置魔法url, 上述hosts文件作相应修改, 复制bing.com cookies至魔法域名。 <a href="https://gitee.com/jja8/NewBingGoGo/blob/master/docs/%E5%88%9B%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E9%AD%94%E6%B3%95%E9%93%BE%E6%8E%A5.md">详情</a></p>
|
可配置魔法url, 上述hosts文件作相应修改, 复制bing.com cookies至魔法域名。 <a href="https://gitee.com/jja8/NewBingGoGo/blob/master/docs/%E5%88%9B%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E9%AD%94%E6%B3%95%E9%93%BE%E6%8E%A5.md">详情</a></p>
|
||||||
</li>
|
</li>
|
||||||
|
@ -86,8 +86,8 @@ UA为非默认时,点击PC按钮将恢复UA为默认,同时触发不保存UA
|
||||||
<a href="../filenames">配置文件列表</a>中直接点击文件名即可编辑。</p>
|
<a href="../filenames">配置文件列表</a>中直接点击文件名即可编辑。</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<p>Last Modified: 6 April 2023<br>
|
<p>Last Modified: 7 April 2023<br>
|
||||||
bingAI: complete<br>
|
bingAI: minor optimization<br>
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue