From e8b5f412f04b7eea757f3e65629151e986415ed9 Mon Sep 17 00:00:00 2001 From: James Feng Cao Date: Fri, 7 Apr 2023 14:43:41 +0800 Subject: [PATCH 1/4] bingAI: use https://mybing2.xn--xyza.top as default --- en/searchurl/bingAI/bing.html | 2 +- sitemap.xml | 2 +- zh/_posts/index.xml | 2 +- zh/index.xml | 2 +- zh/sitemap.xml | 6 +++--- zh/tips/index.html | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/en/searchurl/bingAI/bing.html b/en/searchurl/bingAI/bing.html index c8a280b..9f17909 100644 --- a/en/searchurl/bingAI/bing.html +++ b/en/searchurl/bingAI/bing.html @@ -77,7 +77,7 @@ async function getMagicUrl() { let v = localStorage.GoGoUrl; if(v) return v; - return "https://muweb.us.to/"; + return "https://mybing2.xn--xyza.top/"; } diff --git a/sitemap.xml b/sitemap.xml index 9e9e232..24b9f4d 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -11,7 +11,7 @@ zh/sitemap.xml - 2023-04-06T09:03:54+08:00 + 2023-04-07T14:38:07+08:00 diff --git a/zh/_posts/index.xml b/zh/_posts/index.xml index 21f1936..d7e0924 100644 --- a/zh/_posts/index.xml +++ b/zh/_posts/index.xml @@ -19,7 +19,7 @@ 复制bing.com cookies至魔法域名 勾选选项“使用离线缓存”, "使用hosts" hosts文件内添加一行(允许发送cookie至魔法url): -Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true muweb.us.to +Click to append to "hosts", edit the last part as magic url domain 点击界面入口 可配置魔法url, 上述hosts文件作相应修改, 复制bing.com cookies至魔法域名。 详情 方法2: 可以采用超级书签/直接界面+脚本+hosts。 diff --git a/zh/index.xml b/zh/index.xml index a68c36a..b2f561b 100644 --- a/zh/index.xml +++ b/zh/index.xml @@ -19,7 +19,7 @@ 复制bing.com cookies至魔法域名 勾选选项“使用离线缓存”, "使用hosts" hosts文件内添加一行(允许发送cookie至魔法url): -Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true muweb.us.to +Click to append to "hosts", edit the last part as magic url domain 点击界面入口 可配置魔法url, 上述hosts文件作相应修改, 复制bing.com cookies至魔法域名。 详情 方法2: 可以采用超级书签/直接界面+脚本+hosts。 diff --git a/zh/sitemap.xml b/zh/sitemap.xml index 42a8f69..f3f496e 100644 --- a/zh/sitemap.xml +++ b/zh/sitemap.xml @@ -3,7 +3,7 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml"> /zh/_posts/ - 2023-04-06T09:03:54+08:00 + 2023-04-07T14:38:07+08:00 /zh/ - 2023-04-06T09:03:54+08:00 + 2023-04-07T14:38:07+08:00 /zh/tips/ - 2023-04-06T09:03:54+08:00 + 2023-04-07T14:38:07+08:00 勾选选项“使用离线缓存”, "使用hosts"

hosts文件内添加一行(允许发送cookie至魔法url):
-Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true muweb.us.to

+Click to append to "hosts", edit the last part as magic url domain

点击界面入口
可配置魔法url, 上述hosts文件作相应修改, 复制bing.com cookies至魔法域名。 详情

@@ -86,8 +86,8 @@ UA为非默认时,点击PC按钮将恢复UA为默认,同时触发不保存UA 配置文件列表中直接点击文件名即可编辑。

-

Last Modified: 6 April 2023
-bingAI: complete
+

Last Modified: 7 April 2023
+bingAI: minor optimization


 

From 95c5410f00e018d025e3aa7cb5797dedab0395e2 Mon Sep 17 00:00:00 2001 From: James Feng Cao Date: Fri, 7 Apr 2023 15:32:34 +0800 Subject: [PATCH 2/4] hosts to support both ip address and response headers --- en/_posts/index.xml | 4 ++-- en/adblock_domain/index.html | 24 ++++++++++++++---------- en/index.xml | 4 ++-- en/sitemap.xml | 10 +++++----- en/tags/adblock/index.xml | 4 ++-- sitemap.xml | 2 +- 6 files changed, 26 insertions(+), 22 deletions(-) diff --git a/en/_posts/index.xml b/en/_posts/index.xml index b724240..95f3238 100644 --- a/en/_posts/index.xml +++ b/en/_posts/index.xml @@ -48,8 +48,8 @@ Long pressing the bookmark button in uweb browser will popup menus defined in fi /en/adblock_domain/ The enhanced hosts files "hosts" and "default.hosts" take effect when the setting option "using hosts" is checked. The enhanced file "hosts" defines IP addresses/attributes for domains. Each line has the following format: -[IP address/attributes][single space][domain name] -where "[IP address/attributes]" could be: +[[IP address][attributes]][single space][domain name] +where "[[IP address][attributes]]" could be: ipv4 address such as: 172.67.157.211 torapp.eu.org ipv6 address, Ex.: diff --git a/en/adblock_domain/index.html b/en/adblock_domain/index.html index 68c58ee..4e00805 100644 --- a/en/adblock_domain/index.html +++ b/en/adblock_domain/index.html @@ -51,8 +51,8 @@

The enhanced hosts files "hosts" and "default.hosts" take effect when the setting option "using hosts" is checked.

The enhanced file "hosts" defines IP addresses/attributes for domains. Each line has the following format:
-[IP address/attributes][single space][domain name]

-

where "[IP address/attributes]" could be:

+[[IP address][attributes]][single space][domain name]

+

where "[[IP address][attributes]]" could be:

  • ipv4 address such as:
    @@ -65,22 +65,26 @@

  • empty, that would lift all server-imposed limitations. Ex.:
    [single space]gitee.com

    +

    which will make all git repositories on the domain visitable as websites with raw file access url.

    +
  • +
  • +

    response headers, separeded by ';', Ex.:
    +Access-Control-Allow-Origin;*;Access-Control-Allow-Credentials;true mybing2.xn--xyza.top

    +

    which makes "mybing2.xn--xyza.top" to accept CORS requests with cookies.

    +
  • +
  • +

    IP address and response headers, separeded by ';', Ex.:
    +172.64.80.1;Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true wild-cake-ff77.jamesfengcao.workers.dev

-

which will make all git repositories on the domain visitable as websites with raw file access url.

-
    -
  • response headers, separeded by ';', Ex.:
    -Access-Control-Allow-Origin;*;Access-Control-Allow-Credentials;true mybing2.xn--xyza.top
  • -
-

which makes "mybing2.xn--xyza.top" to accept CORS requests with cookies.

"default.hosts" 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.

Each line of the hosts file has the following format:
[rootDomain][space][regex for domain prefix before rootDomain][space][regex for the whole url without "http(s)://"]
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.

-

Last Modified: 3 April 2023
-bingAI to support cors with cookies
+

Last Modified: 7 April 2023
+hosts to support both ip address and response headers


 

diff --git a/en/index.xml b/en/index.xml index d6ff861..00956e6 100644 --- a/en/index.xml +++ b/en/index.xml @@ -48,8 +48,8 @@ Long pressing the bookmark button in uweb browser will popup menus defined in fi /en/adblock_domain/ The enhanced hosts files "hosts" and "default.hosts" take effect when the setting option "using hosts" is checked. The enhanced file "hosts" defines IP addresses/attributes for domains. Each line has the following format: -[IP address/attributes][single space][domain name] -where "[IP address/attributes]" could be: +[[IP address][attributes]][single space][domain name] +where "[[IP address][attributes]]" could be: ipv4 address such as: 172.67.157.211 torapp.eu.org ipv6 address, Ex.: diff --git a/en/sitemap.xml b/en/sitemap.xml index 43de400..769370d 100644 --- a/en/sitemap.xml +++ b/en/sitemap.xml @@ -3,7 +3,7 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml"> /en/_posts/ - 2023-04-03T17:48:42+08:00 + 2023-04-07T15:29:47+08:00 /en/ - 2023-04-03T17:49:38+08:00 + 2023-04-07T15:29:47+08:00 /en/tags/adblock/ - 2023-04-03T17:48:42+08:00 + 2023-04-07T15:29:47+08:00 /en/adblock_domain/ - 2023-04-03T17:48:42+08:00 + 2023-04-07T15:29:47+08:00 /en/tags/ - 2023-04-03T17:48:42+08:00 + 2023-04-07T15:29:47+08:00 /en/adblock_domain/ The enhanced hosts files "hosts" and "default.hosts" take effect when the setting option "using hosts" is checked. The enhanced file "hosts" defines IP addresses/attributes for domains. Each line has the following format: -[IP address/attributes][single space][domain name] -where "[IP address/attributes]" could be: +[[IP address][attributes]][single space][domain name] +where "[[IP address][attributes]]" could be: ipv4 address such as: 172.67.157.211 torapp.eu.org ipv6 address, Ex.: diff --git a/sitemap.xml b/sitemap.xml index 24b9f4d..17b2200 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -4,7 +4,7 @@ en/sitemap.xml - 2023-04-03T17:49:38+08:00 + 2023-04-07T15:29:47+08:00 From 441db3a1f45be976d2d6844cca4c85757b3dbf37 Mon Sep 17 00:00:00 2001 From: James Feng Cao Date: Fri, 7 Apr 2023 18:07:09 +0800 Subject: [PATCH 3/4] add workers for bingAI --- en/adblock_domain/index.html | 6 +++--- en/searchurl/cloudflare/bing.js | 29 +++++++++++++++++++++++++++++ en/sitemap.xml | 10 +++++----- sitemap.xml | 2 +- 4 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 en/searchurl/cloudflare/bing.js diff --git a/en/adblock_domain/index.html b/en/adblock_domain/index.html index 4e00805..0aad1b0 100644 --- a/en/adblock_domain/index.html +++ b/en/adblock_domain/index.html @@ -69,12 +69,12 @@
  • response headers, separeded by ';', Ex.:
    -Access-Control-Allow-Origin;*;Access-Control-Allow-Credentials;true mybing2.xn--xyza.top

    +Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true mybing.xn--xyza.top

    which makes "mybing2.xn--xyza.top" to accept CORS requests with cookies.

  • IP address and response headers, separeded by ';', Ex.:
    -172.64.80.1;Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true wild-cake-ff77.jamesfengcao.workers.dev

    +104.21.8.195;Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true uweb.torapp.eu.org

  • "default.hosts" 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.

    @@ -84,7 +84,7 @@ The first part [rootDomain] is required and the others are optional. regex is ja

    Last Modified: 7 April 2023
    -hosts to support both ip address and response headers
    +add cloudflare/bing.js

    
     

    diff --git a/en/searchurl/cloudflare/bing.js b/en/searchurl/cloudflare/bing.js new file mode 100644 index 0000000..01a4711 --- /dev/null +++ b/en/searchurl/cloudflare/bing.js @@ -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); +} + diff --git a/en/sitemap.xml b/en/sitemap.xml index 769370d..f96c5fe 100644 --- a/en/sitemap.xml +++ b/en/sitemap.xml @@ -3,7 +3,7 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml"> /en/_posts/ - 2023-04-07T15:29:47+08:00 + 2023-04-07T18:05:06+08:00 /en/ - 2023-04-07T15:29:47+08:00 + 2023-04-07T18:05:06+08:00 /en/tags/adblock/ - 2023-04-07T15:29:47+08:00 + 2023-04-07T18:05:06+08:00 /en/adblock_domain/ - 2023-04-07T15:29:47+08:00 + 2023-04-07T18:05:06+08:00 /en/tags/ - 2023-04-07T15:29:47+08:00 + 2023-04-07T18:05:06+08:00 en/sitemap.xml - 2023-04-07T15:29:47+08:00 + 2023-04-07T18:05:06+08:00 From 6a726e893c7449769f16210e5338afcbb8a301ad Mon Sep 17 00:00:00 2001 From: James Feng Cao Date: Fri, 7 Apr 2023 21:38:56 +0800 Subject: [PATCH 4/4] add deno/bing.js --- en/adblock_domain/index.html | 2 +- en/searchurl/deno/bing.js | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 en/searchurl/deno/bing.js diff --git a/en/adblock_domain/index.html b/en/adblock_domain/index.html index 0aad1b0..9b94106 100644 --- a/en/adblock_domain/index.html +++ b/en/adblock_domain/index.html @@ -84,7 +84,7 @@ The first part [rootDomain] is required and the others are optional. regex is ja

    Last Modified: 7 April 2023
    -add cloudflare/bing.js
    +add bing.js for cf & deno

    
     

    diff --git a/en/searchurl/deno/bing.js b/en/searchurl/deno/bing.js new file mode 100644 index 0000000..b4dd138 --- /dev/null +++ b/en/searchurl/deno/bing.js @@ -0,0 +1,24 @@ +import { serve } from "https://deno.land/std@0.140.0/http/server.ts"; +async function handler(req: Request): Promise { + 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);