-
Notifications
You must be signed in to change notification settings - Fork 298
修复 无法通过GitHub链接安装脚本 #877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
修复 无法通过GitHub链接安装脚本 #877
Conversation
|
这个问题就不修复先,下个版本(1.3)和 #842 一起吧 |
1d21f62 to
8bce443
Compare
| requestMethods: ["get" as chrome.declarativeNetRequest.RequestMethod], | ||
| }; | ||
| const browserType = getBrowserType(); | ||
| if (browserType.chrome && browserType.chromeVersion >= 128) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
responseHeaders与excludedResponseHeaders 都需要 >= 128 的版本,是不打算兼容旧版本的浏览器了么?(虽然我也想,恶心的兼容性) https://developer.chrome.com/docs/extensions/reference/api/declarativeNetRequest?hl=zh-cn#:~:text=main_frame%20%E8%B5%84%E6%BA%90%E7%B1%BB%E5%9E%8B%E3%80%82-,responseHeaders,-HeaderInfo%5B%5D%C2%A0%E5%8F%AF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不使用 excludedResponseHeaders
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
我试了一下,chrome.webNavigation.onBeforeNavigate + chrome.tabs.update 似乎也可以实现类似效果,🤔这样的话,可以写复杂一些的规则,特殊处理? 我看了一下其它的: https://gitlab.com/gitlab-org/gitlab/-/blob/master/README.md -> https://gitlab.com/gitlab-org/gitlab/-/raw/master/README.md https://gitea.com/gitea/act_runner/src/branch/main/README.md -> https://gitea.com/gitea/act_runner/raw/branch/main/README.md chrome.webNavigation.onBeforeNavigate.addListener((nav) => {
console.log("onBeforeNavigate", nav);
if (nav.url.endsWith(".user.js") && !nav.url.includes("script_installation")) {
// 处理 user.js 脚本
chrome.tabs.update(nav.tabId, {
url: `${DocumentationSite}${localePath}/docs/script_installation/#url=${nav.url}`,
});
}
}); |
不要這樣搞 用dnr就行 我提交的代碼沒有相容性問題 |
确实dnr的更好,那可能就需要再多条规则去处理 Github/Gitlab/Gitea 代码页的问题。 兼容性问题,你看我后续的回复 #877 (comment) |
改了 |
|
close #876 |
| excludedRequestDomains: ["github.com", "gitlab.com", "gitea.com", "bitbucket.org"], // Chrome 101+ | ||
| }, | ||
| { | ||
| regexFilter: "^(.+?\\.user(\\.bg|\\.sub)?\\.js&response-content-type=application%2Foctet-stream)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种应该是可以不匹配的(不过无所谓,可以少点规则)
* 不依赖外部网站访问进行安装 * Update script.ts * 修正 fetchScriptBody * css * css * css * i18n t * css * css * 显示 7.5 个项目来提醒使用者以滚动浏览更多 * 空白调整 * . * 兼容修正 * #876 * lint * i18n * #877 * #877 修正 * 合并 * typescript fix * Update src/locales/de-DE/translation.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/pages/install/App.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/pages/install/App.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chrome.runtime.lastError * fix * 中文 * formatBytes * 整理代码和添加单元测试 * 修复typecheck * 添加dels测试 --------- Co-authored-by: 王一之 <yz@ggnb.top> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>


概述
变更内容
截图