-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
maxcdn.bootstrapcdn.com 替换为 lib.baomitu.com ;新增 code.jquery.com 域名下的…
… jquery 替换 (#89) * add func remove CSP * 新增参考文档 * 添加测试用例 * 添加替换地址为指定服务地址功能,用于查看chromium源码 * add docker run nginx server * 补上80端口配置 * add opensource.goole url * add cs.opensource.google url * 使用自己架设的 nginx服务地址替换CDN地址 * change CSP variable name * 添加固定替换CDN地址方法 * 替换指定数目的域名 * 添加测试用例 * 优化nginx 配置 * 优化nginx 配置二 * 优化nginx 配置三 * 优化nginx 配置增加简单权限验证阻止滥用 * 优化nginx 配置五 * 添加测试演示用例 * 添加测试演示用例 * 修改动态地址替换注释 * 修改错误的单词 * 移除与扩展无关的server文件 * 去除普通用户无关的测试脚本以及服务端搭建脚本 * 修改maxcdn.bootstrapcdn.com替换地址 * 替换code.jquery.com 为 ajax.aspnetcdn.com * code.jquery.com 地址替换 * 1、增加域名替换白名单机制;2、两种地址替换方法,依靠优先级混合使用;3新增code.jquery.com域名下jquery 替换 * delete ytb * 新增高级玩法 * 新增test service-worker * change changelog * add replace jquery-ui
- Loading branch information
1 parent
dc8d859
commit 28166eb
Showing
22 changed files
with
439 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# CHANGELOG | ||
|
||
|
||
## CHANGELOG for 0.10.2 | ||
### 变更 | ||
>1. 新增test service-worker `sw.js` 小工具,解决因域名地址替换导致出现的问题;比如 github PJAX 错误 | ||
>2. 新增test service-worker `sw.js` 小工具中 `self-define-browser-editor.js` 浏览器当作记事本使用 | ||
>3. 新增test service-worker `sw.js` 小工具中 `tools/myscript-tools.js` 开启"上帝"模式,可编辑网页 | ||
>4. 新增test service-worker `sw.js` 小工具中 `tools/myscript-tools.js` 查看网页引入的所有域名 | ||
>5. 新增 `code.query.com` jquery 地址替换 | ||
>6. 解决 0.10.1 版本中 `第10,11条不能共用问题` | ||
>7. 删除 0.10.1 版本中 高级玩法excludedInitiatorDomains错误配置 位于 `rules/rules_advance_redirect_2.json : "excludedInitiatorDomains":[] ` | ||
>8. maxcdn.bootstrapcdn.com 替换为 lib.baomitu.com | ||
|
||
## CHANGELOG for 0.10.1 新增适配 chromium manifest v3版本 | ||
### 变更 | ||
|
||
>1. `manifest.json -> manifest-v2.json` (已复制保存) | ||
>2. `background.js` 不再使用了 | ||
>3. `manifest.json: manifest_version -> 3` | ||
>4. 新增 `chromium manifest v3 declarativeNetRequest rules ` | ||
>5. 新增 `v3 redirect url rule (rules/rules_redirect_1.json)` | ||
>6. 新增 `v3 remove response header rule` 可以移除CSP选项 ` (rules/rules_remove_header_1.json)` | ||
>7. 新增 `v3 append request header rule` 可向请求头添加内容 `(rules/rules_append_header_1.json)` | ||
>8. 新增 `v3 block request header rule` 锁请求 `(rules/rules_block_1.json)` | ||
>9. 新增 v3 固定替换地址 rule `(rules/rules_advance_redirect_1.json)` | ||
>10. 新增 v3 动态替换地址 rule ` (rules/rules_advance_redirect_2.json)` | ||
>11. 上述第9-10条不能同时使用,会产生冲突 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"priority": 99, | ||
"action": { | ||
"type": "redirect", | ||
"redirect": { | ||
"regexSubstitution": "lib.baomitu.com/jquery/\\1/jquery\\2" | ||
} | ||
}, | ||
"condition": { | ||
"regexFilter": "code.jquery.com/jquery-(\\d{1,4}\\.\\d{1,4}\\.\\d{1,4})(.*?)", | ||
"requestDomains":[ | ||
"code.jquery.com" | ||
], | ||
"resourceTypes": [ | ||
"main_frame", "sub_frame", "stylesheet", "script", "image", "font", | ||
"object", "xmlhttprequest", "ping", "csp_report", "media", "websocket", | ||
"webtransport", "webbundle", "other" | ||
] } | ||
}, | ||
{ | ||
"id": 2, | ||
"priority": 99, | ||
"action": { | ||
"type": "redirect", | ||
"redirect": { | ||
"regexSubstitution": "ajax.aspnetcdn.com/ajax/jquery.ui/\\1/\\2" | ||
} | ||
}, | ||
"condition": { | ||
"regexFilter": "code.jquery.com/ui/(\\d{1,4}\\.\\d{1,4}\\.\\d{1,4})/(.*?)", | ||
"requestDomains":[ | ||
"code.jquery.com" | ||
], | ||
"resourceTypes": [ | ||
"main_frame", "sub_frame", "stylesheet", "script", "image", "font", | ||
"object", "xmlhttprequest", "ping", "csp_report", "media", "websocket", | ||
"webtransport", "webbundle", "other" | ||
] } | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
## chromium extension v3 | ||
|
||
> 一个完整的 测试 | ||
# 修改 manifest.json 文件测试配置,结果如下: | ||
```text | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
自定义样式 | ||
*/ | ||
|
||
|
||
|
||
|
||
/* | ||
一句话网页变灰 -css | ||
*/ | ||
|
||
/* | ||
html { filter: grayscale(100%); } | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"use strict" | ||
|
||
console.log('注入js,css 代码',window.location) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
// * chrome - the global namespace for Chrome's extension APIs | ||
// * runtime – the namespace of the specific API we want to use | ||
// * onInstalled - the event we want to subscribe to | ||
// * addListener - what we want to do with this event | ||
|
||
chrome.runtime.onInstalled.addListener(async () => { | ||
console.log( "onInstalled do nothing ") | ||
console.log(chrome.runtime.getURL("js/sw.js")) | ||
console.log(chrome.runtime.getURL("js/myscript.js")) | ||
console.log(chrome.runtime.getURL("js/tools/self-define-browser-editor.js")) | ||
console.log(chrome.runtime.getURL("js/tools/myscript-tools.js")) | ||
|
||
}); | ||
|
||
chrome.tabs.onUpdated.addListener( (tabId, changeInfo, tab) => { | ||
console.log( "oonUpdated do nothing ") | ||
|
||
if (changeInfo.status === 'complete' && /^http/.test(tab.url)) { | ||
|
||
// 注入JS 或者CSS 解决 PJAX 不可用问题等问题 | ||
console.log(tab.url) | ||
try{ | ||
chrome.scripting.executeScript( | ||
{ | ||
target: {tabId: tabId}, | ||
files: ["js/myscript.js"] | ||
}, | ||
(injectionResults=null) => { | ||
|
||
} | ||
) | ||
chrome.scripting.insertCSS( | ||
{ | ||
target: {tabId: tabId}, | ||
files: ["css/my.css"] | ||
}, | ||
(injectionResults=null) => { | ||
|
||
} | ||
) | ||
}catch(error){ | ||
console.log(error) | ||
}finally { | ||
if (chrome.runtime.lastError) { | ||
message.innerText = 'There was an error : \n' + chrome.runtime.lastError.message; | ||
} | ||
} | ||
} | ||
|
||
}); |
Oops, something went wrong.