views:

50

answers:

2

I can't seem to get all Javascript functionality to work on the WebBrowser Control (linked below)

This could possibly be due to the same-domain issue - local html files have some ajax that calls address on external server. Is there a way to modify the control to omit the same domain?

http://msdn.microsoft.com/en-us/library/aa752040(VS.85).aspx

A: 

XMLHttpRequest (ajax) does not work cross domain, unless you proxy your requests to be on the same domain, though this will not work for local html files run from the disc without a server.

The alternative is JSONP, which works anywhere.

see: http://stackoverflow.com/questions/2067472/please-explain-jsonp

BGerrissen
A: 

Yes you can implement IInternetSecurityManager::GetSecurityId on the host to return the same value for the script urls you want to put in the same domain.

Sheng Jiang 蒋晟
since you are a vC++ mvp, what do you think of the security issues @Delan mentioned in comments above?
ina
The WebBrowser control is designed to work in full trust only. If you run the browser against untrusted web sites I suggest you to start your process in the low integrity level. Please refer to the All-In-One Code Framework's CreateLowIntegrityProcess sample for details.
Sheng Jiang 蒋晟