通过chrome devtools扩展程序将调试器附加到worker [英] Attach debugger to worker from chrome devtools extension

查看:102
本文介绍了通过chrome devtools扩展程序将调试器附加到worker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在chrome devtools扩展程序中拦截ws消息.

I was trying to intercept ws messages in my chrome devtools extension.

这个问题对我有所帮助.这正是我所需要的,但是唯一的问题是,仅当从页面上下文发送websocket消息时,它才起作用(我想是因为调试器专门连接到该选项卡?),但是在页面中,我试图拦截在网络工作者中建立了ws连接的消息.

This question helped me. This is exactly what I need, but the only problem is that it this works only if websocket messeages are sent from the page context (I guess because the debugger is attached to that tab specifically?) but in the page i'm trying to intercept the messages the ws connection is stablished in a web worker.

我的主要问题是,chrome devtools扩展中是否可以附加"调试器给网络工作者?或者也许我在这里缺少什么?

My main question, is there a way in a chrome devtools extensions to "attach" a debugger to a web-worker? Or maybe I am missing something here?

感谢您的帮助.

推荐答案

找到了原因.

我无法使用 chrome.debugger API截取所需页面中的WebSockets框架.

I won't be able to intercept the WebSockets frames in the page I needed with the chrome.debugger API.

显然,扩展似乎无法访问通过 about: data: blob:方案加载的上下文,我想拦截WebSocket框架在通过Blob URL加载的工作程序中建立连接.

Apparently, it seems extensions lack access to contexts loaded via about:, data: and blob: schemes and I wanted to intercept the WebSocket frames establishes the connection in a worker that is loaded via a blob url.

查看相关的Chrome错误:
https://bugs.chromium.org/p/chromium/issues/detail?id = 55084 https://bugs.chromium.org/p/chromium/issues/detail?id = 388972

See related Chrome bugs:
https://bugs.chromium.org/p/chromium/issues/detail?id=55084 https://bugs.chromium.org/p/chromium/issues/detail?id=388972

这也是FF中的错误:
https://bugzilla.mozilla.org/show_bug.cgi?id=1475831

It's also a bug in FF:
https://bugzilla.mozilla.org/show_bug.cgi?id=1475831

这篇关于通过chrome devtools扩展程序将调试器附加到worker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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