0

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

ina
  • 19,167
  • 39
  • 122
  • 201
  • (Comment not answer because isn't a direct answer) Please don't use the WebBrowser control. Internet Explorer, embedded or not, is a major security risk and should never be used in any software. – Delan Azabani Aug 15 '10 at 09:56
  • What then is a better way to write a desktop wrapper for a website? – ina Aug 15 '10 at 21:03

2 Answers2

0

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: What is JSONP all about?

Community
  • 1
  • 1
BGerrissen
  • 21,250
  • 3
  • 39
  • 40
0

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 蒋晟
  • 15,125
  • 2
  • 28
  • 46
  • since you are a vC++ mvp, what do you think of the security issues @Delan mentioned in comments above? – ina Aug 15 '10 at 21:06
  • 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 蒋晟 Aug 21 '10 at 17:22