It sounds like you're looking for window.navigator.registerContentHandler:
https://developer.mozilla.org/en/DOM/window.navigator.registerContentHandler
...except a website can only register themselves as a content-handler. You could probably hack up a bookmarklet to do it, if you can't find an XSS vector, but I can't seem to make it work myself.