Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug a Chrome browser extension which is crashing?

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.

like image 464
Zane Claes Avatar asked Aug 31 '12 16:08

Zane Claes


People also ask

How do I debug Chrome from crashing?

For Chrome devices, try to diagnose the issue by collecting Chrome device debug logs and using Log Analyzer. For browser issues, try to diagnose the issue by collecting Chrome browser debug logs. If crash reporting is enabled, browse to chrome://crashes to find the crash IDs and file a bug.

How do I debug Chrome extensions?

Navigate to the chrome extensions management page at chrome://extensions and ensure developer mode is on. Click the Load Unpacked button and select the broken extension directory. After the extension is loaded, it should have three buttons: Details, Remove and Errors in red letters.

How do I fix a broken Chrome extension?

Re-enable Malfunctioning Extensions Open the three-dot menu from the top-right corner. Head to More tools > Extensions. Use the toggle for each extension to turn it off. Restart Chrome and go back to the extensions list.

Why do my Chrome extensions keep crashing?

If your extensions get updated, the new update is not compatible with your browser, and that's why your Chrome keeps crashing. So you should temporarily disable the add-ons and extensions in your Chrome to fix the crashing issues.


1 Answers

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.

enter image description here

like image 67
Mike Grace Avatar answered Oct 04 '22 16:10

Mike Grace