gpt4 book ai didi

javascript - 在chrome扩展中获取 "Remote Address"(IP地址)

转载 作者:行者123 更新时间:2023-12-01 16:29:41 24 4
gpt4 key购买 nike

我正在开发一个 Chrome 扩展程序,我想在其中获取来自 Chrome 客户端的每个服务器请求的 IP 地址。例如,请看这张图片:

developer tools screenshot

是否有任何我可以使用的 Chrome 扩展 javascript API 会给我这种数据?

最佳答案

我能够使用 webReqest API 做到这一点!

list .json

...
"permissions": ["webRequest", "*://*/*"]
...

背景.js

chrome.webRequest.onResponseStarted.addListener(
({ip}) => console.log(`Network request with ${ip}!`),
{urls: ['*://*/*']});

关于javascript - 在chrome扩展中获取 "Remote Address"(IP地址),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53126208/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com