Requestly 是否可以修改 Chrome 扩展的网络请求?

huangapple go评论62阅读模式
英文:

Is it possible to modify network requests of a Chrome extension using Requestly?

问题

我正在尝试解决Coinbase钱包Chrome扩展程序的问题,该扩展在尝试添加自定义网络时会发出不正确的网络请求(具体来说是eth_chainId请求结构不正确)。我希望拦截这些请求并修改它们,使其正确。

我知道有像Requestly这样的工具,允许修改网页发出的网络请求。但是,由于Chrome的安全模型,我不确定是否可以使用这些工具来修改其他Chrome扩展程序发出的请求。

是否有办法使用Requestly或类似的工具来修改由Chrome扩展程序发出的网络请求?如果不能,是否有任何替代方法或工具可以实现这一目标?我尝试过,但Requestly似乎没有拦截扩展程序的任何请求。

更多背景信息,Coinbase钱包扩展程序发出的请求如下所示:

curl https://testnet.hashio.io/api \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_chainId"}'

它应该发出的请求(即请求体中应该包含paramsid字段)如下:

curl https://testnet.hashio.io/api \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_chainId","params":[],"id":1,"jsonrpc":"2.0"}'
英文:

I'm attempting to work around an issue with the Coinbase Wallet Chrome extension where it's making incorrect network requests(specifically badly structured eth_chainId request) when trying to add a custom network. I want to intercept these requests and modify them so they're correct.

I'm aware of tools like Requestly, which allow for the modification of network requests from web pages. However, I'm unsure if it's possible to use these tools to modify requests made by other Chrome extensions due to Chrome's security model.

Is there a way to use Requestly or a similar tool to modify network requests made by a Chrome extension? If not, are there any alternative methods or tools I could use to achieve this? I've tried but Requestly does not seem to intercept any of the extension's requests.

For more context, the request the Coinbase wallet extension makes:

curl https://testnet.hashio.io/api \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_chainId"}'

The request it should make(i.e. should have params and id fields in the request body):

curl https://testnet.hashio.io/api \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_chainId","params":[],"id":1,"jsonrpc":"2.0"}'

答案1

得分: 2

浏览器扩展有一个限制,它们无法监听来自其他扩展的流量。这就是为什么 Requestly 浏览器扩展无法修改这种类型的网络请求。

为了克服这个限制,您可以使用 Requestly 桌面应用程序。它提供与浏览器扩展相同的用户界面,但具有额外的功能和灵活性,因为它没有面临任何限制。只需启动一个新的 Chrome 实例或从 Connect Apps 连接到一个现有的实例,所有的请求都会显示在网络流量页面中。

Requestly 是否可以修改 Chrome 扩展的网络请求?

英文:

Browser extension have limitation that they can't listen to traffic from other extensions. That's why Requestly Browser extension can't modify these kind of network requests.

To overcome this limitation, you can use Requestly Desktop App. It offers the same user interface as the browser extension but with additional power and flexibility as as it doesn't face any limitations. Just launch a new chrome instance or connect to an existing one from the Connect Apps, and all the requests will show up in the Network Traffic Page

Requestly 是否可以修改 Chrome 扩展的网络请求?

huangapple
  • 本文由 发表于 2023年6月19日 17:26:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76505303.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定