How to programmatically allow Internet Explorer to use javascript and to play videos without user confirmation?

  activex, c++, internet-explorer, javascript, shell

I am able to control Internet Explorer window in C++ using:

IWebBrowser2 *browser
CoCreateInstance(
    CLSID_InternetExplorer, 
    NULL, 
    CLSCTX_SERVER, 
    IID_IWebBrowser2, 
    (void**)&browser
);

And I navigate to a local html file that contains the following:

<video controls width="640" height="480">
    <source src="video.mp4"></source>
</video>

When I run the program the internet explorer opens fine but it asks me to "Allow blocked content"
in order for the video to be able to be played. Same thing happens when I for example add some javascript in html file.

This is how it looks

My question is next: How can i prevent IE from showing me that popup and allow it to use ActiveX or Javascript programmatically. Any help would be much appreciated.

Source: Windows Questions C++

LEAVE A COMMENT