google-chrome-devtools - Chrome 网络请求表中带有齿轮图标的名称

标签 google-chrome-devtools web-worker

enter image description here

enter image description here

(pic1 中的 30119999.xml,有一个齿轮标记 pre name)

我在 Web Worker 中设置了这个请求,响应数据没问题,我在 onmessage 回调中终止了它

但是为什么请求总是处于待处理状态并且无法预览,请帮助。

伪代码:

const workerBlob = new Blob([`onmessage = function (event) {
    const xhr = new XMLHttpRequest();
    xhr.addEventListener('load', function () {
        postMessage(xhr.response);
    });
    xhr.open('GET', event.data.url, true);
    xhr.send();
}`], { type: 'application/javascript' });
const workerURL = URL.createObjectURL(workerBlob);
const worker = new Worker(workerUrl);
worker.postMessage({url});
worker.onmessage = (message) => {
    // do something
    worker.terminate();
};

最佳答案

根据 Debugging Service Workers :

The gear icon signifies that these requests came from the Service Worker itself. Specifically, these are the requests being made by the Service Worker's install handler to populate the offline cache.

关于google-chrome-devtools - Chrome 网络请求表中带有齿轮图标的名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48336926/

相关文章:

jquery - 在滚动填充输入框时重新绘制

javascript - 您可以单步执行在 chrome 开发工具(控制台)中创建的函数吗?

android - WebView with service worker(什么是ServiceWorkerController和ServiceWorkerWebSettings?)

google-chrome - Chrome 开发者工具 - 网络 - 如何仅过滤 POST 和 PATCH 请求?

jQuery 自定义 ajax 构建

google-chrome-devtools - jekyll + service worker 失败 : service worker does not successfully serve the manifest's start_url

JavaScript Worker - 并行写入控制台

javascript - Dart 到 javascript 工作人员

javascript - 为什么 JSON.parse 会更改嵌套数组中的值?