34 ms·
It sounds like you're looking for window.navigator.registerContentHandler: https://developer.mozilla.org/en/DOM/window.navigator.registerContentHandler ..
by thristian 17y ago
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.
- blasdel 17y agoSo... close... It'd be easy to make a greasemonkey-style extension that calls this on *, but it wouldn't work for links to other domains (which I'd bet are the majority of PDF links)
- jacquesm 17y agoThat would already be very useful though, for things like online papers and datasheets, which as a rule sit on the same server as the page you're looking at.
- legooolas 17y agoIt's becoming more common to use a separate domain for static content like this to be cached more effectively (and to have no cookies etc sent), so it may not always be the same server as the page you're looking at.