'2016/12/09'에 해당되는 글 1건

  1. 2016.12.09 Debugging JavaScript in a WebBrowser Control from Visual Studio
2016. 12. 9. 06:27

Debugging JavaScript in a WebBrowser Control from Visual Studio

<< 웹뷰 자바스크립트 디버깅하기 >>


참고 : http://blogs.perl.org/users/mark_leighton_fisher/2011/09/debugging-javascript-in-a-webbrowser-control-from-vs2010.html


You can debug JavaScript executing inside a WebBrowser control embedded in your .NET 4.0 application from VS2010 (Visual Studio 2010), but it takes a little effort.


  1. Enable Script Debugging (both IE and Other) in Internet Explorer.
  2. Disable friendly HTTP messages in Internet Explorer.
  3. Enable Display a notification about every script error in Internet Explorer.
  4. Modify VS2010 to debug Script from the Attach Process dialog. Please note that you cannot debug both JavaScript (Script) and .NET 4.0 code at the same time. (I don't know why.)
  5. Add a debugger statement at the start of your JavaScript.
  6. Start your WebBrowser-embedded application without debugging (Ctrl-F5).
  7. When your application hits the JavaScript debugger; statement, select your current instance of VS2010.
  8. Voilà! You can now debug the JavaScript executing inside the WebBrowser control in your .NET 4.0 application. 

여기서 꿀팁은 debugger statement 를 javascript 에 추가해서 디버깅하는 것 같다. 



IE 에서 참고해야할 설정
 

Open Internet Explorer, go to Settings, tab Advanced, and, in the “Navigation” section:


  • Uncheck “disable script debugging” (both IE and Other)
  • Uncheck “Display friendly HTTP messages”
  • Check “Display a notification about every script error”