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