This isn't a .Net group. I have no idea how that might play
into what you want to do. I also don't get what you mean by
"some sort of client side code". If you want to have a toolbar
button isn't that an entirely client-side operation?
I don't know whether this will help but I have a VBScript
package that does what you want. It's an ad-blocking utility
that gets the IMG SRC URLs of the current webpage and
offers to add any selected URLs to the HOSTS file. The IE 5,6
version does it by running the script from a toolbar button.
(I don't know of any way to add a button to IE4, Mozilla or Opera.)
The script finds the open IE window that the click came from
by iterating through the Shell.Application Windows collection.
The Windows collection is a collection of Shell Explorer windows
but what is actually returned are IE objects. So ShellApp.Windows
includes all folders and IE instances that are open. Once you've got
that you can use the IE DOM:
'-- Where Win is a Windows collection item:
HTMLofPage = Win.Document.body.innerhtml
URLofPage = Win.LocationURL
For the full code with button sample:
http://www.jsware.net/jsware/zips/hosts.zip
If you make a true browser extension for your button it gets an
IE reference indirectly passed to it. I don't know whether .Net can
build browser extensions. VB can do it through use of a Typelib that
defines the interfaces used.
In the case of just creating a button your
only option, as far as I know, is to open the file of your choice
when the button is clicked. I don't know of a way to get any kind
of pointer to the IE instance with that. (A button gets created through
the Registry Extensions key but it doesn't necessarily have to be
connected with a browser extension.) Hence the ShellApp.Windows
workaround.
I am looking for help on the following. I'm trying to create a custom
browser toolbar button that will do a few things. One that I'm trying
to do at the moment is just simply return the URL of whatever page the
user is visiting.
I wanted to create a Win32 application using VB.NET. If there is a
better way of doing this please let me know. I assume there needs to
be some sort of client side code. I was originally leaning towards
using "Request.Path.ToString" or "Request.ApplicationPath.ToString"
but these require server based execution.
For the time being, I'm creating a simple VB.NET Win32 application
with 1 button. The onclick of which should be able to access the URL
of the existing page. However, since the application isn't part of any
browser yet, I'm unsure of how to access information about the page.
Any ideas on the code to use and how to implement this? I'm looking
for some code examples and direction on how to go about this (ie.
create an executable from the win32 application, etc). Maybe there is
some javaScript that can be used. I will eventually be creating a
toolbar similar to that explained in the following link:
http://msdn.microsoft.com/library/de...owser/ext/tuto
rials/button.asp.