Re: VB6 : WebBrowser Control : Disablign JavaScript support
- From: "Sarah M. Weinberger" <mweinberger@xxxxxxxxxxx>
- Date: Mon, 16 Nov 2009 16:23:02 -0800
Hi Mayayana and All,
The problem is that I have an existing site that I am reading the HTML
source for programatically. There are links on the page that I want to
navigate to, when a user takes certain actions. I can easily extract the
href sub-tag for the anchor tag easily. My problem is that the href tag for
this particular site uses JavaScript as the reference. At a basic level,
the anchor tag looks as follows:
<a href="JavaScript: theURL(argument1, argument2);">text for the anchor
comes here.</a>
I can extract the href component, but how do I translate that into a
meaningful URL? I have the WebBrowser control and the .Navigate method?
NOTE: A strange behavior is that if I open the page up in IE8 I see the
JavaScript version, but I also see a bunch of noscript portions. I can
easily use that. The problem is that loading in the HTML source from the
WebBrowser control does not yield the exact same html source. With the VB6
WebBrowser control I get more or less the same HTML source but less all the
noscript stuff. I do not know why WebBrowser does that, but it does. I was
thinking that if I could somehow turn off JavaScript support for the
WebBrowser control, then I could get the noscript option. Other options
would be to somehow get the WebBrowser control to show the noscript stuff.
Yet another possibilty is to somehow execute the JavaScript and get the
actual URL that I need from the funciton, but how do I do that?
Thanks,
Sarah
"mayayana" <mayaXXyana@xxxxxxxxx> wrote in message
news:%23uTyxlxZKHA.4312@xxxxxxxxxxxxxxxxxxxxxxx
The WB properties and methods are nearly identical
to IE, so I don't think there's anything you can do
directly. You could get the page first and remove the
script, but that would be messy. You could also
temporarily change the settings in the Registry, but
that would also affect IE instances. And depending on
where the page loads from you have up to 40 possible
settings to change for each IE setting! IE settings have
gone from bizarre to hopeless. For just active scripting
alone the value to change is named "1400". But to be
thorough you need to change it in HKLM and HKCU,
multiplied by 5 zones, multiplied again by 2 for normal
settings and lockdown settings, and finally multiplied
by 2 again because if group policy settings have been
made there will be a complete mirror collection of
settings under Software\Policies\Microsoft\ (as opposed
to Software\Microsoft\).
Is it possible to programatically tell the WebBrowser control that
JavaScript is not available? Is that some sort of option that I would
set
prior to calling the .Navigate method?
Thanks.
Sarah.
.
- Follow-Ups:
- Re: VB6 : WebBrowser Control : Disablign JavaScript support
- From: mayayana
- Re: VB6 : WebBrowser Control : Disablign JavaScript support
- From: Nobody
- Re: VB6 : WebBrowser Control : Disablign JavaScript support
- From: mayayana
- Re: VB6 : WebBrowser Control : Disablign JavaScript support
- References:
- VB6 : WebBrowser Control : Disablign JavaScript support
- From: Sarah M. Weinberger
- Re: VB6 : WebBrowser Control : Disablign JavaScript support
- From: mayayana
- VB6 : WebBrowser Control : Disablign JavaScript support
- Prev by Date: Re: VB6 : WebBrowser Control : Disablign JavaScript support
- Next by Date: Re: Preventing an app from being run remotely
- Previous by thread: Re: VB6 : WebBrowser Control : Disablign JavaScript support
- Next by thread: Re: VB6 : WebBrowser Control : Disablign JavaScript support
- Index(es):
Relevant Pages
|