Re: IHTMLWindow2::execScript breaks after IE7 RC1



"He Shiming" <mailbill(NOSPAM)@21cn.com.nospam> wrote in message
news:OD6nmhZyGHA.2036@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

My program hosts a web browser control. It's written in ATL and it pretty
much follows the atlbrowser.exe sample. I implemented the
IInternetSecurityManager, to override security settings. In
IInternetSecurityManager::ProcessUrlAction, I set *pPolicy to
URLPOLICY_ALLOW. For all other functions, I return
"INET_E_DEFAULT_ACTION". Additionally, I used the IPersistStreamInit
interface (obtained from IHTMLDocument2) to feed the HTML content into the
web browser.

To provide dynamic interaction functions, I've built several javascript
libraries, they are loaded in the HTML code through <script
src="C:\\something.js"/>. By using IHTMLWindow2::execScript, I'm able to
call these functions from the host program to accomplish interaction
tasks.

This works up to Internet Explorer 7 Beta 3. I just installed the IE7 RC1
update. All calls to IHTMLWindow2::execScript breaks. All calls will bring
up an "Internet Explorer Script Error" dialog. The error message includes:

Invalid character at Line 2 Char 1
Object expected at Line 1 Char 1
...and some others

I wasn't able to debug because there's nothing wrong with the javascript
code. The very same code works on IE7 Beta3 or IE6 if that matters.

I'd reviewed the release notes for IE7 RC1 and I didn't see an obvious
reason for this to break. I also tried setting several security options in
the Internet Zone (IPersistStreamInit works in the Internet Zone, and the
URL is always about:blank), including Enabling scripting of Internet
Explorer, and the behavior is still the same.

I'm wondering if anyone can give me a hint on fixing this problem. I
thought using IHTMLWindow2::execScript is a recommended way to interact
between the hosted browser control and the host program. Has anyone
experienced similar problems? How can I fix it?

Thanks in advance,
--
He Shiming



I managed to solve the problem by calling CoInternetSetFeatureEnabled
(FEATURE_LOCALMACHINE_LOCKDOWN, SET_FEATURE_ON_PROCESS, TRUE); to override
security settings.

Best regards,
He Shiming


.



Relevant Pages

  • IHTMLWindow2::execScript breaks after IE7 RC1
    ... IInternetSecurityManager, to override security settings. ... IHTMLDocument2) to feed the HTML content into the web browser. ... call these functions from the host program to accomplish interaction tasks. ... the Internet Zone (IPersistStreamInit works in the Internet Zone, ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: IE6 Can not get into particular website
    ... Likely it has to do with your Security settings. ... you need to add it to your Trusted Sites or HOSTS file. ... So I wondered it is the DNS setting, but after refresh the DNS of that ... Then I installed another web browser in that machine, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: sygate and shields up
    ... Please first read RFC 792 and try to understand it. ... that a packet to this host cannot be routed (ICMP Destination ... you wanted to communicate with, you get a message: ... > your IP, and anything else your security settings allow, if it wants ...
    (comp.security.firewalls)
  • Re: Trouble executing ActiveXObject
    ... >Its saying that this page does not have access to this object. ... >You might experiment with changing your browser's security settings. ... page/scirpt wil be run from a host server by many people, ...
    (microsoft.public.scripting.jscript)
  • Re: Password
    ... you need to make a subweb, publish it and apply security settings to the ... folder - check with your host about this. ... > areas of a web site. ...
    (microsoft.public.frontpage.client)