admin 管理员组文章数量: 1086019
Is there a way, with Chrome DevTools, to see what’s going on in a BroadcastChannel
other than attaching a message
event listener to it, so that I could see who’s postMessage
-ing what?
Is there a way, with Chrome DevTools, to see what’s going on in a BroadcastChannel
other than attaching a message
event listener to it, so that I could see who’s postMessage
-ing what?
- 2 No, there is none. – woxxom Commented Dec 19, 2019 at 4:31
1 Answer
Reset to default 9The best solution I found was extending the prototype of postMessage
like this:
(function(postMessage) {
BroadcastChannel.prototype.postMessage = function (message) {
debugger;
postMessage.call(this, message);
};
}(BroadcastChannel.prototype.postMessage));
You can obviously replace the debugger
statement by something else like console.trace(message)
for example, than you get the callstack directly printed in the console.
I hopes this helps you.
本文标签: javascriptHow do I inspect a BroadcastChannel with Chrome DevToolsStack Overflow
版权声明:本文标题:javascript - How do I inspect a BroadcastChannel with Chrome DevTools? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744062601a2526997.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论