I copy below what I wrote in the MS Office forum about exactly the same question. So the javascript code to get the current URL is there already, I should say.
The problems left:
- how to bind javascript to a new icon on the toolbar
- how "favorites" work
- how "history" works
"I looked for you in my 5th edition of Danny Goodman's Javascript Bible. On page 543 he discusses the difference between window.location.href and document.URL. The last one seems to be what you're looking for.
I don't know how to add a script to a newly created button on the toolbar, however; the Coding and Scripting forum should be of more help.
But why don't you go and study Firefox? That's open source, meaning you can get the full source and see how it works. Much easier than trying to reverse engineer IE yourself, in my opinion."
Any additions are welcome, of course.
Kees
I wont to create a new icon in the IE toolbar that can get the current IE window URL. I allready created the icon but I want to know how to write the script that can get me the current URL. For example I want to know how the "Favorites" icon actes, from where it takes the URL and saves in the favorites folder? allso the "History" option in IE. Please if there is anyone that can help me I'll be very glad. thank you!!!

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic