I have a native (windows) application that has an embedded web browser. Currently I'm invoking a javascript function from the backend (c++/c#). However, if javascript is disabled this fails and I'd like to provide a fallback mechanism. Is there a way to determine if javascript is disabled?
A:
In the IE Web Control, you can simply force JavaScript on. Please refer to the following interfaces, which your host has to implement:
- IDocHostUIHandler
- IDocHostShowUI
- IInternetSecurityManager
- IServiceProvider
Another approach would be for your HTML page to query the window.external object and call a method on it, which you implement in your host, which sets a flag to true. Not being called would mean the JavaScript was not executed.
Alexander Gräf
2009-10-12 23:58:01
The IInternetSecurityManager was just what I needed. I found a nice explination of how to implement it here... http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/thread/c6b9bfbb-12b4-47f8-8dda-c89646358f52
herbrandson
2009-10-13 22:09:00