Fog Creek Software
Discussion Board




MS Web Browser Control

Can anyone direct me to an example, or documentation for how to write on-the-fly generated HTML to a web browser control, that allows you to use file system based html component files?

Because the domain of the page (about:blank, I believe) does not match the domain of the .htc files (file:///c:...) IE security blocks the script from executing.

I'm sure that I'm trying to do this the stupid/wrong way.

Thanks

Joe Patterson
Friday, December 19, 2003

WSH.Shell should give you access to the filesystem.  However, use of this object requires lowering the security settings of the browser to allow scripting of Active X controls not marked as safe for scripting.  So, essentially, you would only want to use this for an app served from an intranet web server behind a firewall and you would want to change that security setting for the clients only for the Local Intranet security zone.

anon
Friday, December 19, 2003

have you looked into HTAs? (HTML Applications)? If you're in a controlled environment, they're basically 'applications' running in a webbrowser like context with very open security.

mb
Friday, December 19, 2003

Are HTA's the successors of ActiveX Documents? Any good link on learning about those?

Frederic Faure
Friday, December 19, 2003

Re. HTAs:
http://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixPost=56618

Duncan Smart
Friday, December 19, 2003

See Duncan's link for more info.
But specifically, HTAs have nothing to do with ActiveX Documents. (well, the HTML will be rendered by MSHTML which is one, but that's irrelevant.)

mb
Friday, December 19, 2003

I have experimented a little with HTA's, but that's not exactly what I am looking for.  I am using the web browser control as one part of a larger application.  I don't know how to overcome the security issue of writing HTML to the web browser's document, and using .htc's from the filesystem.

Joe Patterson
Friday, December 19, 2003

if you're hosting the weboc, you can do other things. load both the page and the htc from the filesystem, but have the hosting app overwrite the content in the page, or have the page just call document.write(window.external.pagecontentshere).
write your own protocol to pull in all the data. (a nightmare).
write everything to the filesystem and load it all from there.

beware of the changes in XP SP2. the security stuff is there for good reason.

there are probably other ways too.

mb
Saturday, December 20, 2003

*  Recent Topics

*  Fog Creek Home