Can't be done. Not directly in a browser, anyway.
If the browser is loading the page, you can arrange to get
notifications at various points during the load. However, elements in
the page are added asynchrounously as the browser receives them, and
there's no notification you can subscribe to in order to find out when
individual elements are added.
You could, for example, attach to the body.onLoad event, but, by the
time this event fires, all script blocks will have been parsed and
loaded, and any global-scope code will have already executed.
You could fetch the page yourself (using WinHTTP or WinINET APIs),
modify it, and then write the result into the browser using
document.write() on an empty page.
To call functions like document.write(), you will need to obtain the
root DOM object, and then procede to make calls on that object using
the IDispatch (or IDispatchEx) interface. Developer Tools for Attachmate Products - Tech Note 2183:: NET, using the Reflection ActiveX control, and downloading C# and VB.NET code samples: Technical Note 1799. Programming with Reflection Visual Basic http://support.attachmate.com/techdocs/2183.htmlHOME | Amazon.com: Sams Teach Yourself Visual C# 2005 in 24 Hours :: Everything you need to get your feet wet with Visual C#, November 12, 2006 Working with a Database; Controlling Other Applications Using Automation http://www.amazon.com/Teach-Yourself-Visual-Complete-Starter/dp/0672327406HOME |
Thank you so much, at least I can stop beating my head against the
wall trying to control IE, I guess I'll consider doing what you've
suggested, I write a search toolbar with the added feature of
controlling popups but its not a perfect world, primarily because I
don't know the source of NewWindow2() calls, but also there are new
methods of causing popups that don't get caught by NewWindow2().
Thanks mucho! 15 Seconds : Creating a Component using Visual C++ to Manipulate :: Controlling a web site using ADSI is fairly easy (15 Seconds ADSI section). Creating an Active Server Component using Visual C++ 5.0 to control IIS, http://www.15seconds.com/issue/990107.htmHOME |
You need to look into ActiveX for this.
Oh. And you can also attach to nagivation events too. So. The plot summary:
Catch navigation events. Intercept them and cancel them.
Take the intercepted URL, load the contents yourself.
Clear the document.
Write the modified contents using document.write().
There are other challenges: e.g. do you want to preserve POSTed URLs
as well as GET-ed URLs? (i.e. do you want forms processing to work
properly). This is solvable, but will probably require a fair bit of
work. VT Emulation .NET Sample, Emulation C# demo, VT .NET sample:: This sample demonstrates how easy it is to put a browser-based front-end on a legacy The Vt control is used in a non-visual fashion to load a local file http://www.dart.com/samp_emulationnet.aspxHOME |
Any chance you could be a bit more specific? Do I need to write an
object which somehow gets loaded with the page? Would I set that up
with an OnLoad command? How can I do that before the page is
processed? Any other hints, re: activeX ?
Where's The Advantage In Windows Genuine Advantage?
Stocks Bounce After S&P Joins Bear Market
|