ReplaceGoogleCDN 演示例子规则文件 位于本项目的
rules
目录
# vi https-switch-to-http-proxy.sh
socat -d -d TCP4-LISTEN:8016,reuseaddr,fork ssl:http-proxy.xiaoshuogeng.com:8017,verify=1,snihost=http-proxy.xiaoshuogeng.com,commonname=http-proxy.xiaoshuogeng.com,openssl-min-proto-version=TLS1.3,openssl-max-proto-version=TLS1.3
# 备注: 服务端就是一个 nginx 仅此而已
# socat 需要支持TLSv1.3
# 使用代理
export http_proxy=http://127.0.0.1:8016
export https_proxy=http://127.0.0.1:8016
export no_proxy="127.0.0.1,localhost"
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git --depth=1 --progress
{
"declarative_net_request": {
"rule_resources": [
{
"id": "remove-header",
"enabled": true,
"path": "rules/rules_remove_header_1.json"
},
{
"id": "ruleset_redirect_1",
"enabled": true,
"path": "rules/rules_advance_redirect_1.json"
},
{
"id": "ruleset_redirect_2",
"enabled": true,
"path": "rules/rules_advance_redirect_1.json"
},
{
"id": "block",
"enabled": true,
"path": "rules/rules_block_1.json"
}
]
}
}
github.com
->github-com.proxy.domain.com
真实测试地址:
https://github.com/
->https://github-com.proxy.xiaoshuogeng.com/
{
"id": "ruleset_advance_redirect_1",
"enabled": true,
"path": "rules/rules_advance_redirect_1.json"
}
www.chromium.org
->https://2_www_xn--3px_chromium_xn--3px_org.proxy.domain.com
真实测试地址 https://chromium.googlesource.com/chromium/tools/depot_tools.git
-> https://2_chromium_xn--3px_googlesource_xn--3px_com.proxy.xiaoshuogeng.com/chromium/tools/depot_tools.git
{
"id": "ruleset_advance_redirect_2",
"enabled": true,
"path": "rules/rules_advance_redirect_1.json"
}
{
"id": "ruleset_block_header_1",
"enabled": true,
"path": "rules/rules_block_1.json"
}
{
"host_permissions": [ //指定地址写法
"*://ajax.googleapis.com/*",
"*://fonts.googleapis.com/*",
"*://themes.googleusercontent.com/*",
"*://fonts.gstatic.com/*",
"*://ssl.gstatic.com/*",
"*://www.gstatic.com/*",
"*://secure.gravatar.com/*",
"*://maxcdn.bootstrapcdn.com/*",
],
"host_permissions": [ //所有地址写法,最省事
"*://*.google.com/*",
"*://*/*",
"<all_urls>"
]
}
sh startup-local-test-web-server.sh
- manifest-format
- manifest-format
- WebExtensions API
- webextensions-examples
- extensions declare_permissions
- extensions webRequest
- extensions chrome.tabs api
- extensions proxy
- contextMenus
- declarativeNetRequest ResourceType
- trusted_types_on_webui
- content_scripts
- scripting executeScript
- Content-Security-Policy/trusted-types
- gerrit
- chromium
- chromium source code
- chromium.googlesource
- chromium project
- Browse or Search Chromium Code
- opensource.google all projects
- declarativeNetRequest 的 ManifestV3 示例
- Proxy_Auto-Configuration_PAC_file
- use fetch
- chromium use proxy
- depot_tools
- puppeteer
- puppeteer example
- chrome-devtools-protocol
- pyppeteer
- webrtc/samples
- ReplaceGoogleCDN
- ReplaceGoogleCDN test example
- ReplaceGoogleCDN 依赖 公共 CDN 静态资源库
- 中文域名 punycode标准编码
- latest chromium
- latest firefox
- 正则表达式 - 元字符
- HTTP请求方法对照表
- Array.from()
- Promise.all()
- Array() 构造器
- MutationObserver 监视对 DOM 树更改
- 内容安全策略(CSP)
- 汉字 Unicode 编码范围
- 汉字字符集编码查询
- GoogleChrome/samples
# download chromium
sh download-latest-chromium.sh
# run chromium
sh chromium.sh
# use proxy build
export PROXY_URL=http://127.0.0.1:8015
sh build-prepare-codelab.sh
域名串不允许有除“-”以外的标点符号,包括空格。 可以夹杂中文和英文。 可以输入全角英文字母,全角字母不区分大小写。