Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
这个 PR 提供了对
chrome
命名空间的代理的支持。具体来说这个 PR 做了以下修改:setChromeProxy
和getChromeProxy
函数来设置/获取chrome
命名空间的代理,具体用法参见注释;chrome
的引用都换成了getChromeProxy()
。此外这个 PR 还做了以下修改:
src/universal_tools
目录移动到src/common/tools
目录,并修改了对应的引用。你可以通过以下方法来验证这个 PR:
ChromeProxy
:这个 PR 有一个类型安全的问题:对
chrome
代理后 IDE 无法提供函数签名的提示(如src/extension/content/index.ts
的getChromeProxy().runtime.onMessage.addListener(...)
函数)。这个问题我暂时没有想到好的解决办法。This PR provides support for proxying the
chrome
namespace. Specifically, the following changes have been made in this PR:setChromeProxy
andgetChromeProxy
functions to set/get the proxy for thechrome
namespace. For specific usage, please refer to the comments;chrome
in the repository withgetChromeProxy()
.Additionally, the following changes have been made in this PR:
src/universal_tools
directory tosrc/common/tools
and updated the corresponding references.You can verify this PR using the following method:
ChromeProxy
using the following code in an appropriate location:There is a type safety issue with this PR: After proxying
chrome
, the IDE cannot provide function signature hints (such as in thegetChromeProxy().runtime.onMessage.addListener(...)
function insrc/extension/content/index.ts
). I haven't come up with a good solution to this problem yet.