1

I have come across an issue when I add a TWebBrowser to a Delphi form and then load a webpage either from file, i.e. wb1.Navigate('file://myhtml.html'); or navigate to the exact page stored on a website, i.e. wb1.navigate('http://mysite/myhtml.html');

It seems to process the CSS differently whether I load the page locally or from the website in IE itself!

I have made sure the page has <!DOCTYPE html> which is meant to force IE9 as a minimum from what I have read.

Anyone seen anything like this before?

This is what it looks like if I load the page using TWebBrowser:

enter image description here

In IE, it displays the data correctly side by side horizontally.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
JCoulter
  • 21
  • 3
  • 1
    Welcome to Stack Overflow. It is a Q&A site. What exactly is your question? – MartynA May 31 '16 at 20:22
  • "I have made sure the page has which"... missing a word there. This post would be improved by a) providing the CSS in question b) a screenshot of how the page is supposed to look. – Noumenon May 31 '16 at 20:31
  • 1
    Have you tried opening these pages in IE directly. By default IE disables some web page content usually referred as `Active content` when such page is loaded from local file. Also until your application is properly registered in Registry the content in TWebBrowser will always be shown in IE7 compatibility mode. A way to overcome this is explained here: http://stackoverflow.com/a/25843958/3636228 – SilverWarior May 31 '16 at 21:22
  • Thanks for that. Yes it was the compatibility mode. I had seen that article but was not 100% sure if there was another way to do it or if it would resolve it. The downside is I now need to alter the registry for my app. but so long as the security is ok, it should be fine. – JCoulter May 31 '16 at 22:20
  • 1
    This may also help: [Controlling WebBrowser Control Compatibility](https://blogs.msdn.microsoft.com/patricka/2015/01/12/controlling-webbrowser-control-compatibility/) – Jan Doggen Jun 01 '16 at 11:07
  • JCoultier, you don't have to change the registry if you have the webpage under control, just add meta tag `` to the head section... – whosrdaddy Jun 01 '16 at 15:05
  • Possible duplicate of [How to put the WebBrowser control into IE9 into standards?](http://stackoverflow.com/questions/4097593/how-to-put-the-webbrowser-control-into-ie9-into-standards) – whosrdaddy Jun 01 '16 at 15:06

1 Answers1

1

Thanks. It was the compatibility mode that was the issue.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
JCoulter
  • 21
  • 3