-
Notifications
You must be signed in to change notification settings - Fork 9
Update i18n #53
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
Update i18n #53
Conversation
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8. - [Release notes](https://github.com/ai/nanoid/releases) - [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md) - [Commits](ai/nanoid@3.3.7...3.3.8) --- updated-dependencies: - dependency-name: nanoid dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Adapt firefox * support firefore auto publish * support firefox, and optimized UX
* [i18n] Translate messages.json in pt_BR 100% reviewed source file: 'messages.json' on 'pt_BR'. * [i18n] Translate messages.json in zh_CN 100% reviewed source file: 'messages.json' on 'zh_CN'. * [i18n] Translate messages.json in zh_TW 100% reviewed source file: 'messages.json' on 'zh_TW'. * [i18n] Translate messages.json in pt_BR 100% reviewed source file: 'messages.json' on 'pt_BR'. * update English i18n msg --------- Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com> Co-authored-by: SYM01 <33443792+SYM01@users.noreply.github.com>
* [i18n] Translate messages.json in pt_BR 100% reviewed source file: 'messages.json' on 'pt_BR'. * [i18n] Translate messages.json in zh_TW 100% reviewed source file: 'messages.json' on 'zh_TW'. * [i18n] Translate messages.json in zh_CN 100% reviewed source file: 'messages.json' on 'zh_CN'. --------- Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* [WIP] support chrome auto deploy * finalize Chrome auto deploy * npm audit fix * npm audit fix
* [i18n] Translate messages.json in pt_BR 100% reviewed source file: 'messages.json' on 'pt_BR'. * [i18n] Translate messages.json in zh_TW 100% reviewed source file: 'messages.json' on 'zh_TW'. * [i18n] Translate messages.json in zh_CN 100% reviewed source file: 'messages.json' on 'zh_CN'. --------- Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* [i18n] Translate messages.json in zh_TW 100% reviewed source file: 'messages.json' on 'zh_TW'. * [i18n] Translate messages.json in zh_CN 100% reviewed source file: 'messages.json' on 'zh_CN'. * [i18n] Translate messages.json in pt_BR 100% reviewed source file: 'messages.json' on 'pt_BR'. --------- Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
Summary of ChangesHello @SYM01, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces significant enhancements to the extension's proxy management capabilities, focusing on intelligent auto-switching and real-time user feedback. It implements a dynamic system to select proxy profiles based on URL patterns and IP ranges, alongside a new service for tracking web request statistics per tab. These changes are supported by comprehensive updates to browser API abstractions, dependency versions, and the build process, aiming to provide a more robust and user-friendly experience. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a significant new feature for 'auto switch' mode, allowing for tab-specific proxy detection and display, which is a great enhancement. The changes are extensive, including dependency updates, major refactoring of the browser adapters, and the addition of new services and components to support this functionality. The implementation is generally solid and well-tested.
My review focuses on a few key areas for improvement. I've identified a critical type-safety issue in the Firefox adapter related to the onWebRequestAuthRequired event handler, which stems from an abstraction that doesn't fully align with Manifest V3 standards. I've also pointed out some leftover debugging code and commented-out blocks that should be removed for better code hygiene. Addressing these points will improve the robustness and maintainability of the codebase.
| ): void { | ||
| browser.webRequest.onAuthRequired.addListener( | ||
| callback, | ||
| callback as any, |
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.
The use of callback as any bypasses TypeScript's type safety and hides a fundamental issue. The onWebRequestAuthRequired signature in BaseAdapter is designed for Chrome's Manifest V2 (using an async callback), but this project uses Manifest V3, which requires the listener to return a Promise. This mismatch will cause authentication to fail in MV3 environments.
To fix this, the event handling should be refactored to be promise-based.
Recommended change in src/adapters/base.ts:
// src/adapters/base.ts
abstract onWebRequestAuthRequired(
callback: (details: WebAuthenticationChallengeDetails) => Promise<BlockingResponse | undefined>
): void;This will require updating ProxyAuthProvider.onAuthRequired in src/background.ts to be an async function that returns a Promise, which is the correct pattern for MV3 and will also work for Firefox, removing the need for the as any cast.
| // this.stats.addFailedRequest(details); | ||
| // TODO: update indicator | ||
| const proxySetting = await getCurrentProxySetting(); | ||
| console.log("onResponseStarted", details); |
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.
| // mocking | ||
| // tabStats.value = { | ||
| // failedRequests: [], | ||
| // currentProfile: { | ||
| // profile: { | ||
| // profileID: "profile1", | ||
| // profileName: "Profile 1", | ||
| // proxyType: "proxy", | ||
| // color: "#000000", | ||
| // proxyRules: { | ||
| // default: { | ||
| // host: "127.0.0.1", | ||
| // port: 8080, | ||
| // }, | ||
| // bypassList: [], | ||
| // }, | ||
| // }, | ||
| // isConfident: true, | ||
| // }, | ||
| // tabID: props.currentTab.id, | ||
| // }; | ||
| // console.log(tabStats.value); | ||
| }; |
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.
| sender: MessageSender, | ||
| sendResponse: (response: any) => void | ||
| ) => { | ||
| console.debug("stats:get", message, sender, sendResponse); |
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.
No description provided.