Search code examples
javascriptc++visual-studiodebuggingiwebbrowser2

Debugging javascript / html rendered with IWebBrowser2 in C++


I'm working with Pandion (open source jabber client), the C++ sets up a host for running html/javascript using IWebBrowser2. All of the program logic is implemented in js. In VS2010 if I start the application in the debugger, I can debug the C++ but not the js. If I start without the debugger and then attach it, I can debug the js but not the C++.

  1. Is there any way to be able to debug both?
  2. Is there any way to display the html the way firebug would in Firefox, or the developer tools in IE?

The specific error I'm trying to solve is that when updating, the update window closes even though its not supposed to. Something calls submit on the html form, the js then calls a c++ function to abort the file download. I'm trying to track down what calls submit, but the stack window just shows the anonymous function bound to onsubmit.


Solution

  • Found the answer to the specific problem: the "download installer" button was created using document.createElement("button"), which defaulted to a submit button. I added button.type = "button" below it, and now the form is not submitted prematurely.

    However, I still can't find any way of switching between debugging c++ code and js code, so trying to track down where some c++ calls a js function is nearly impossible.