Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re-enabling javascript for each new page loaded?

2 views
Skip to first unread message

John McCaskey

unread,
Dec 14, 2008, 5:47:23 PM12/14/08
to
I'm embedding IWebBrowser2 into my application and I'm trying to
figure out why Javascript stops executing after certain pages are
loaded and does not ever resume regardless of navigating away to other
pages (it resumes in IE itself).

I'm already looking for OLECMDID_SHOWSCRIPTERROR in
IOleCommandTarget::Exec and returning true to keep executing scripts,
I've also followed the advice at http://support.microsoft.com/kb/317024
for adding a js onerror event to each document to catch JS errors even
if the user has script debugging enabled for IE. This mostly works
and I catch errors in both places successfully and will continue
running script. But it seems there are some errors I still don't
catch in either place, and once I hit one my browser instance is
broken until I destroy it and create a completely new one.

Is there some way to get at the script host (is IActiveScript what I'm
looking for? Can I get a pointer to it somehow from the browser
interfaces?) interface used by the browser and tell it to re-enable
javascript each time the user navigates to a new page?

Thanks for any help or ideas!

rasane

unread,
Apr 16, 2009, 2:36:12 AM4/16/09
to
i have never tried it, but this could be useful for you DLCTL_NO_SCRIPTS -
http://www.tech-archive.net/Archive/InetSDK/microsoft.public.inetsdk.programming.webbrowser_ctl/2005-11/msg00023.html
0 new messages