Re: VB6 : WebBrowser Control : Disablign JavaScript support

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.






.



Relevant Pages

  • Re: Updating Internet Options using a Script
    ... The default out-of-the-box settings allow internet html ... internet files with JavaScript to run, ... Here is a simple html file with JavaScript: ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: javascript > variable reset help!
    ... and the is being passed to the javascript as requested. ... all done via HTML on the client-side. ... that the browser won't recognize as HTML and will therefore ignore. ... > doesn't reset for new input unless you clear your browser settings. ...
    (alt.html)
  • Re: Blocking javascript popup from WebBrowser control.
    ... Explorer and therefore uses the same settings as IE. ... configured to block JavaScript, then the WebBrowser control will also block ... However, as users can change the JavaScript settings within IE themselves, ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Can I get HTML generated by document.write()?
    ... if I have a page that has obfuscated javascript that does ... using the webbrowser control could someone see the HTML that the ...
    (microsoft.public.dotnet.languages.csharp)
  • Windows Form Dictionary
    ... My data is html ... i use webBrowser control on my windows form. ... Javascript can obtain the word if user double click on ...
    (microsoft.public.dotnet.framework.windowsforms)