【问题标题】:Google Chrome webRequest API and swf fileGoogle Chrome webRequest API 和 swf 文件
【发布时间】:2012-02-15 01:01:39
【问题描述】:

由于某种原因,我看不到使用 Google Chrome webRequest API 从 swf 文件(视频)中进行的 HTTP 调用。我有两个文件:background.html + manifest.json。我确实捕获了对 example.com 的正常请求(图像、AJAX、js),但没有捕获在同一页面上的 swf 文件中发出的 AJAX 请求。这可能吗?

background.html

<!DOCTYPE html>
<html>
<head>
<script>

function interceptRequest(request) {
  alert(request.url);
}

chrome.webRequest.onSendHeaders.addListener(
  interceptRequest, 
  { urls: [ '*://*.example.com/*', ] }
);

</script>
</head><body></body>
</html>

ma​​nifest.json

{
"name": "My Extension",
"version": "0.1",
"background_page": "background.html",
"permissions" : [
 "webRequest",
 "*://*/*"
 ]
}

【问题讨论】:

  • 如果 webRequest 没有接收到它,那么它可能会通过插件。尝试打开开发人员的东西(什么叫;))并选择网络。看看能不能成功,如果没有,那我猜你运气不好。
  • 那太糟糕了。查看在给定页面上发出的所有 AJAX 请求会很有用。甚至是给定 swf 文件中的那些。我可以使用 Charles 或 WireShark 等工具查看请求。但我想进行扩展,以帮助跟踪从给定广告/视频发出的所有外部信标请求的性能。

标签: google-chrome google-chrome-extension webrequest


【解决方案1】:

我可以通过选择开发人员工具设置下的“记录 XMLHttpRequests”来解决此问题。希望这对其他人有帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多