I have TWebBrowser component (Delphi 7), and I loaded HTML from memory stream. The HTML code of the page loaded fine, the page is displayed correctly. But when I try to click on any hyperlink with addresses (href attribute value) like "file:///C:/dir/page.html", NOTHING happens. There is no error message, and the browser does not try to go to another page. The URL is 100% correct - when I load the same webpage to the same TWebBrowser instance, but from the file on hard drive, instead of from memory stream, the exactly this link works fine. Any ideas what may be wrong?
I tried to execute the following statements:
OleCheck(WebBrowser.SecurityManager.SetZoneMapping(URLZONE_INTRANET, 'about:blank', SZM_DELETE));
OleCheck(WebBrowser.SecurityManager.SetZoneMapping(URLZONE_TRUSTED, 'about:blank', SZM_DELETE));
OleCheck(WebBrowser.SecurityManager.SetZoneMapping(URLZONE_INTERNET, 'about:blank', SZM_DELETE));
OleCheck(WebBrowser.SecurityManager.SetZoneMapping(URLZONE_UNTRUSTED, 'about:blank', SZM_DELETE));
OleCheck(WebBrowser.SecurityManager.SetZoneMapping(URLZONE_LOCAL_MACHINE, 'about:blank', SZM_DELETE));
OleCheck(WebBrowser.SecurityManager.SetZoneMapping(URLZONE_LOCAL_MACHINE, 'about:blank', SZM_CREATE));
, but they did not change anything (they were executed correctly, without errors, i.e., HRESULT = S_OK all the time). I must say that the component is actually TEmbeddedWB, (it has SecurityManager property) although TWebBrowser behaves the same way - I just re-checked it.
I think about resorting to using a file in the temporary directory.
Thanks to all, I finally worked around the problem by using the file in the temp dir.