Is there a way to enable the IE8 Developer Tools from inside WebBrowser control in a .NET application

后端 未结 5 1771
青春惊慌失措
青春惊慌失措 2021-02-12 11:22

If you have IE8, you may have noticed a really handy feature that MS has added. Hit F12 and Developer Tools, a firebug like debugger, pops up. This is extremely useful for debug

5条回答
  •  情歌与酒
    2021-02-12 11:53

    One option is to open a child window from the embedded page, the child window opens in IE and the Developer Tools work, you can then do

    window.opener
    

    in the console to refer to the parent and manipulate the page.

    Or replace the parents console with the child's and redirect to it.

     var logWindow = window.open();
            logWindow.document.write('Child Log Window\x3Cscript>window.opener.console = console;\x3C/script>

    Child Log Window

    '); window.onunload = function () { if (logWindow && !logWindow.closed) { logWindow.close(); } };

提交回复
热议问题