internet-explorer,webbrowser-control,activexobject , Embed webbrowser control inside IE


Embed webbrowser control inside IE

Question:

Tag: internet-explorer,webbrowser-control,activexobject

How can I create a web browser activeX object inside a HTML document that is being opened with IE?

I have tried something like this, but the object did not display:

<object id="mini" width=300 height=300 classid="CLSID_WebBrowser"</object> ...

Answer:

According to MSDN, since IE6 you should use an iframe instead: https://msdn.microsoft.com/en-us/library/aa752044%28v=vs.85%29.aspx

That said, the following "works" for me in IE11. You have to specify the value of CLSID_WebBrowser:

<object classid="clsid:8856F961-340A-11D0-A96B-00C04FD705A2" id="browser" width="600" height="600" />

You can then do e.g.

document.getElementById("browser").navigate("http://www.example.com")

Edit: However, after the first navigate, any other method calls or property accesses result in "access denied". This is apparently by design: https://support.microsoft.com/en-us/kb/176789

Then IE crashes when I close it so YMMV. I think the lesson here is that this isn't supported and you probably shouldn't be doing it.


Related:


Trying to fire onclick event asp:ImageButton [closed]


asp.net,visual-studio-2010,internet-explorer
My asp:ImageButton doest not fire onclick event on IE, but is working normally on chrome or firefox. Don't know if my code is right, but is here: <asp:ImageButton ID="SaveBtn" runat="server" OnClick="Save_Click" ToolTip="Save" ImageUrl="images/save.png" /> Using .NET Framework 3.5 Note: IE10...

What is the proper way to get the value of a React