问题描述
我开发了Chrome浏览器扩展程序,并且在极少数情况下它会崩溃(例如,右上角显示一个气泡,指出_____已经崩溃!请点击此处重新加载它。)
问题是,当它这样做时,background.html立即消失(死亡),并且我找不到任何信息来帮助我调试出错的地方。我已经打开chrome://崩溃并且看到那里有可能与我的问题相对应的条目,但是崩溃日志只给我一个链接来提交错误报告(无法下载或查看日志)。
根据日志我已经发现了一些.dmp文件,但它们本质上是不可读的(.dmp文件似乎是某种非符号化的堆栈跟踪或某种性质的东西) 。
有人有调试Chrome扩展程序崩溃的好方法吗?
编辑:在进一步调查后,我确定chrome://崩溃与我的扩展崩溃无关。我刚刚发生了崩溃,但chrome://崩溃的最新时间戳是从几个小时前开始的。
,并能够找出根源通过启用详细日志记录启用chrome的问题。要使用详细日志记录在Mac上启动Google Chrome,您需要打开终端并运行类似以下内容:
/应用程序/ Google\ Chrome.app/Contents/MacOS/Google\ Chrome - 启用日志记录--v = 1&
然后通过加载日志文件来观察调试日志文件。
tail -f〜/ Library / Application \ Support / Google / Chrome / chrome_debug.log
在Ubuntu上试试:
tail -f〜/ .config / google -chrome / chrome_debug.log
非常健谈,但它可能足以帮助您解决问题。
I have developed a Chrome browser extension and, on rare occasion, it crashes (eg, a bubble appears in the upper-right stating "_____ has crashed! Click here to reload it.")
The problem is that when it does so, background.html disappears (dies) immediately, and I cannot find any information to help me debug what went wrong. I've opened chrome://crashes and see that there are entries there which might correspond to my issue, but the crash log only gives me a link to file a bug report (no ability to download or view the log).
Based upon this Goole entry on finding crash logs I've found some .dmp files, but they are essentially unreadable (the .dmp files seem to be some sort of un-symbolicated stack trace, or something of that nature).
Does anybody have a good way to debug Chrome extension crashes?
EDIT: after further investigation, I have determined that chrome://crashes do not relate to my extension crashes. I just had a crash, yet the latest timestamp in chrome://crashes is from several hours ago.
I once had a similar issue and was able to figure out the root of the issue by starting chrome with verbose logging enabled. To start Google Chrome on Mac with verbose logging you'll need to open a terminal and run something similar to the following:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --enable-logging --v=1&
Then watch the debug log file by tailing the log file.
tail -f ~/Library/Application\ Support/Google/Chrome/chrome_debug.log
On Ubuntu try:
tail -f ~/.config/google-chrome/chrome_debug.log
It's very chatty but it may be just enough to help you fix your issue.
这篇关于如何调试崩溃的Chrome浏览器扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!