IE 7 RC1 Breaks Scripts
I just installed IE 7 RC1 and my application scripts stopped working. An example:
Dim IE, doc, pics
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "about:blank"
Do until IE.ReadyState = 4: WScript.Sleep 50: Loop
Set doc = IE.document
doc.write("test test <img src='abc.jpg'> test")
set pics = doc.all.tags("IMG")
pics.length now returns 0
Help! Help! What should I modify?
Thanks in advance
kk
PS: It was still ok in the beta before RC1
[629 byte] By [
K.Kong] at [2008-2-14]
Urgent! Help! Help!
I have a long list of jobs held up because they use IE to extract objects in web pages.
Or how do I uninstall IE7 and get back to IE6? IE7 does not appear in Add/Remove Programs. Will uninstall leave my system in a pristine IE 6 state?
K. Kong,
Can you proved a full repro sample of this?
IE7 will be listed in Add/Remove Programs as "Windows Internet Explorer 7" for uninstallation which will return you to IE6.
Thanks
-Dave
The above script is complete. Just to make it more complete I have added two more lines:
Dim IE, doc, pics
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "about:blank"
Do until IE.ReadyState = 4: WScript.Sleep 50: Loop
Set doc = IE.document
doc.write("test test <img src='abc.jpg'> test")
set pics = doc.all.tags("IMG")
Wscript.echo pics.Length
Wscript.quit
Copy and paste to test.vbs. If working pics.Length should show 1 and not 0.
To double confirm I submit below a piece of code I submitted in an earlier bug report on the beta:
const HTMLText="<body>Some text<a href='a.html'>a</a>
<a href='b.html'>b</a>
<a href='c.html'>c</a></body>"
Dim IE, hrefs, hreffor i=1 to 100
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "about:blank"
Do until IE.ReadyState = 4
WScript.Sleep 50
Loop
IE.document.write(HTMLText)
set hrefs = IE.document.all.tags("A")
for each href in hrefs
Wscript.echo href.href
next
IE.quit
set IE = nothing
next
It used to print out three lines in earlier versions of IE and the beta. Now it prints nothing.
Thanks.
I uninstalled Windows Internet Explorer 7 RC1 and it is now back to IE 6 and my scripts now work fine.
I hope to return to IE 7 sometime in the near future. Hope this problem gets resolved soon.
Thanks
kk
Reinstalled IE 7. Put a document.close() as suggested by someone in msnews after document.write(). Didn't work either. Hope someone from IE7 team is monitoring this. connect.microsoft.com seems to have closed the doors for IE 7.
Try adding "about:blank" to your trusted sites list (you'll have to un-check the 'Require server verification (https:) for all sites in this zone).
I've run into a similar issue with IE embedded in VB, and this is the one trick that seems to work. Unfortunately, I don't know if this is the best way, but more importantly I'm not too keen on telling all my customers that they have to do this little hack to get scripting to work in our application. It's definitely something that worked in B3, but not RC1.
Wonder if there was a reason MS restricted this in RC1?
Thanks for the tip. I will have to wait till the next time I install IE7.
This is also an issue for me, so I hope someone can come up with a good solution. In my case, I am using the web browser control (not InternetExplorer.Application) in an MFC application. I am able to write content to the page by doing this:
- Call "open" on the IHTMLDocument2 interface (passing in NULL for the url).
- Call "write" (passing in full HTML for the page as a safearray).
- Call "close".
(What I am doing is similar to this: http://ehartwell.com/Exoware/Tech/SettingHTMLViewTextDirectlyFromString.htm)
However, script does not run as it did before with IE6 (I get a scripting error in "about:blank" line 1). If I add "about:blank" to the trusted sites zone, then everything works fine, but I don't want to do that on user's machines as it would also affect regular instances of IE and could be a security risk.
Some possible solutions I see are:
- Instead of opening a NULL url, I could pass in a url to a blank page on the intranet (to get into the intranet zone) and wait for completion. This would be a slow and poor solution.
- Maybe use a "res:" url to load a blank page from my application? This would probably also be affected by the local machine lockdown, right?
- Implement IInternetHostSecurityManager and change the zone for "about:blank" only within my application. A search on the web comes up with few results for "IInternetHostSecurityManager". Any help? Is there an easier way before I try this option?
- I could go ahead and add "about:blank" to the trusted sites zone, but this is probably a very bad idea as it could be a big security risk.
Thanks,
Walt
Hi,
I am facing exatly the same Problem you have described, I haev to add aabout:blank to the trusted site to make my appliaction work.
Could you please let me know if you have figured out any alternative approach for this?
Thanks,
Prabs
It's worse in MS-Access: Navigating to "about:blank" causes Access to exit, with no error messages!
Please post workarounds soon!
Thanks in advance!
Hi,
Not sure whether it's' relevant to your problem, but try doing this:
- Create and set the following registry key:
HKLM\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BLOCK_LMZ_SCRIPT (registry key)
YourApplication.exe:DWORD(0x0) (registry value)
Prabs Chavan wrote: |
| Not sure whether it's' relevant to your problem, but try doing this: - Create and set the following registry key:
HKLM\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BLOCK_LMZ_SCRIPT (registry key) YourApplication.exe:DWORD(0x0) (registry value) |
|
Thank you! That worked for me.
I had tried something like that before but I must have gotten it wrong, because it works now.
I would like to let all know that after I installed the golden IE7, everything works like before in IE6 with nothing amiss, and without me having to modify anything. Thanks Microsoft.
-kk