My browser extension is crashing occasionally. The problem is, I cannot find a good, comprehensive list of things that can cause an extension to crash, and thus am having a hard time creating a checklist of things to work with.
My assumption is that anything that causes a standard Chrome tab to crash would cause the extension to crash when run in the Background.html file.
Off the top of my head, I'm assuming the following could cause problems...
That's really all I can think of. I'm having a heck of a time trying to debug my extension and would really appreciate any help creating a checklist...
Re-enable Malfunctioning Extensions Head to More tools > Extensions. Use the toggle for each extension to turn it off. Restart Chrome and go back to the extensions list. Re-enable the extensions.
But if you use Chrome Web browser, it turns out there is a simpler way to crash it. Just enter in a specific 16-character string in the address bar of Chrome and it will disappear as if it saw a ghost. Entering in the following 16-character link "http://a/%%30%30" (without the quotes) crashes Chrome.
I'm coming back to this question about 3 months after asking it because a 2nd extension of mine was also crashing. In this case, though, the extension was far simpler -- only about 40 lines of code in the background.js script.
2 operations seemed to be possible culprits: writing to localStorage and using console.log
I have previously observed that it is possible to crash a normal chrome tab by using console.log repeatedly with large objects in a website if you leave the page open for an extended period. Because background.js is always open, it seems like a likely culprit here.
tl;dr Don't use console.log in production. Ever.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With