If you want to send a message to your script from a web page, simply use JScript to open some fake URL, like
http://this.is.some.useful.infoIn your event handler, catch the "before_navigate" event (or whatever it was called) and suppress it by returning S_FALSE. $3- will contain the text of the URL.