在开发者控制台的“网络”选项卡上访问或获取文件 [英] Get access to or acquire files on Network tab in developer console

查看:133
本文介绍了在开发者控制台的“网络”选项卡上访问或获取文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以访问或获取从服务器传递到客户端的文件,以及显示在开发人员控制台中网络选项卡上的文件?

Is possible to access or acquire the files that are passed to the client from the server, the files displayed on the Network tab in the developer console?

我来了在这个问题中,建议使用浏览器扩展技术可以获取日志,但这是一个非常古老的问答。我也有兴趣获取文件,而不是日志。

I came across this question that suggests obtaining the logs may be possible with browser extension technology, but it is a really old question and answer. I am also interested in obtaining the files, not the logs.

有可能吗?

推荐答案

是。。您可以使用服务人员

服务人员是在您的浏览器中运行的脚本,与您的网站。它允许运行不需要任何用户交互(日志/分析)的后台javascript函数。

Service Worker is a script which runs on your browser separated from your website. It allows to run background javascript functions which is not need any user interaction (Logs / Analytics).

服务工作者是可编程的网络代理,可让您控制如何处理页面中的网络请求。

了解服务人员的更多功能

示例服务工作者,将为来自/sw.js 请求激活.google.com rel = nofollow noreferrer> developers.google.com

Sample Service worker which will be activated for all /sw.js requests from developers.google.com


if ('serviceWorker' in navigator) {
  window.addEventListener('load', function() {
    navigator.serviceWorker.register('/sw.js').then(function(registration) {
      // Registration was successful
      console.log('ServiceWorker registration successful with scope: ', registration.scope);
    }, function(err) {
      // registration failed :(
      console.log('ServiceWorker registration failed: ', err);
    });
  });
}




注意:无法使用服务人员拦截其他网站的流量。这就是浏览器级别的控制,为此,您需要使用浏览器级别扩展数据包嗅探器,例如 Wireshark Brupsuite >。

NOTE : You cannot intercept other website's traffic using service workers. That is browser level control, For that you need to use browser level extensions or packet sniffers such as Wireshark or Brupsuite.

这篇关于在开发者控制台的“网络”选项卡上访问或获取文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆