Firefox plugin crashes in Chrome
From what I gather, Google Chrome can run browser plugins written using NPAPI.
I've written one that does its job just fine in Firefox, but makes Chrome crash and burn as soon as you embed it on a page. I don't even have to call any of my methods, embedding is enough to cause a crash.
How do I debug this? I tried attaching the debugger to chrome but the stack traces I get are deep down in Chrome itself and like I said, none of "my" actual code is being run, but supposedly just the NPAPI init code.
I'd appreciate some pointers.
The Chromium dev docs describe some tricks for attaching Visual Studio to Chrome processes: Chromium Developer Documentation > Debugging Chromium.
Some problems you might be facing with an NPAPI plugin in Chrome:
- Your plugin will be running in a separate process from the Chrome UI. (You probably know this already :)
- If multiple instances of your plugin are loaded (in the same HTML page or in different Chrome tabs), your plugin instances will be running in the same process together. If you have global variables, your plugin instances might be stomping on each other.
- Chrome uses DEP (Data Execution Protection), but Firefox does not. If you are using ATL or other JITted code tricks, DEP can crash your plugin.