views:

85

answers:

2

I have IE8 installed on my computer and have been working on automating some tasks in a simple c# application with WebBrowser. Supposedly WebBrowser and IE have to render web pages in the similar way, while in reality I'm stuck with bugs in my application.

To trace the problem I've created small winforms project with single WebBrowser and manually went through the tasks, that have to be automated, using WB and IE - they produced different results.

AFAIK WB uses installed IE engine to render html, I forced FEATURE_BROWSER_EMULATION (8000) too. Why then such problem appear?

P.S. Don't know if this helps, but the problem is about flash video, which loads successfully in IE all the time, but in WebBrowser only once, after reloading or navigating to this flash video again page scripts and flash are malfunctioning.

A: 

You may have to check if your forced feature emulation is correct. If you load a page with a script like that in the WebBrowser:

<script language="Javascript">
<!--
    document.write(navigator.appName);
    document.write("<br/>");
    document.write(navigator.appVersion);
    document.write("<br/>");
// -->
</script>

What do you get?

  • Microsoft Internet Explorer 4.0 (compatible; MSIE 7.0; ... or
  • Microsoft Internet Explorer 4.0 (compatible; MSIE 8.0; ...-

It can happen that if you run the application from vs.net the identity of your application is not "yourapplicationname.exe" but "yourapplicationname.vshost.exe" making your settings fail.

Check with other external pages with flash video like youtube to see if the error still happens.

jmservera
Thank you! This script returned me Microsoft Internet Explorer4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0);
Bogdan
Youtube works perfectly. I can only imagine that the page I'm working with has some flaws in script code, but still beats me because in IE everything is o.k. Forced "*.vshost.exe" as well. Still no improvements.
Bogdan
A: 

After lasting search I've finally found the answer to this scenario.

It seems this is a bug inside flash applicant, precisely this: (cannot load this into reply because of a spam prevention mechanism, though it still is stated in an article, defined deeper).

Problem can be solved if you clear cache source of player before each page navigation. Accurate and detailed view in this case can be found on msdn blog: http://blogs.msdn.com/b/johan/archive/2009/08/06/problems-with-flash-content-in-the-webbrowser-control.aspx

Cheers!

Bogdan