I have a really simple Delphi XE7 program. It is basically just a TWebBrowser component embedded in a form with no extra code attached, other than a button that fires off the Browser.Navigate method. My understanding is that TWebBrowser is just an ActiveX wrapper for IE.
Perhaps there is an issue with having an embedded web browser access locally hosted pages? Additional background -I have also cleared the IE cache, reset the Internet options on the Windows Control Panel, set IE security settings to the minimum level and temporarily disable my Norton Firewall/Virus scanner.
Does anyone have any thoughts on this? I'm really hoping to be able to get some D3 charts embedded in my Windows-based program.
Here also is the html code:
I added answer from your comments below the question so its may helpful to others
add this meta tag into your web page
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
In this case you should add this class to your code:
type TBrowserEmulationAdjuster = class private class function GetExeName(): String; inline; public const // Quelle: https://msdn.microsoft.com/library/ee330730.aspx, Stand: 2017-04-26 IE11_default = 11000; IE11_Quirks = 11001; IE10_force = 10001; IE10_default = 10000; IE9_Quirks = 9999; IE9_default = 9000; /// <summary> /// Webpages containing standards-based !DOCTYPE directives are displayed in IE7 /// Standards mode. Default value for applications hosting the WebBrowser Control. /// </summary> IE7_embedded = 7000; public class procedure SetBrowserEmulationDWORD(const value: DWORD); end platform;
class function TBrowserEmulationAdjuster.GetExeName(): String; begin Result := TPath.GetFileName( ParamStr(0) ); end; class procedure TBrowserEmulationAdjuster.SetBrowserEmulationDWORD(const value: DWORD); const registryPath = 'Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION'; var registry: TRegistry; exeName: String; begin exeName := GetExeName(); registry := TRegistry.Create(KEY_SET_VALUE); try registry.RootKey := HKEY_CURRENT_USER; Win32Check( registry.OpenKey(registryPath, True) ); registry.WriteInteger(exeName, value) finally registry.Destroy(); end;
Finaly add to your OnCreate of the Form:
This should solve your problem