Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在构建一个 chrome 扩展来阻止来自某个主机地址的图像。但是,由于谷歌代理图像,我无法弄清楚要在 chrome webrequest api 中使用的 url 模式。
网址将是这样的。
https://ci6.googleusercontent.con/proxy/hashds93932932-0-3123_#https://targethost.com/track?=trackparams
好的,正如@wOxxOm 指出的那样,我需要检查 details.url 的值。{ details 是 webrequest API 在回调中返回的内容}。我需要在链接上应用正则表达式,这对我有用。如果正则表达式失败,则返回 {cancel:false} 否则返回 {cancel:true}。cancel:true 阻止 Web 请求。