http://www.w3.org/TR/2011/WD-page-visibility-20110602/
Supported in Chrome, Firefox and IE10.
MDN has some information on how to use it:
https://developer.mozilla.org/en-US/docs/Web/Guide/User_expe...
I don't think there is a way server side to detect if the request is for a pre-render or not since I don't think it sends any special headers or anything like that.
If the page you are linking to is time sensitive then you should not be using pre-rendering.
The user won't know if the browser prefetched and prerendered the page before the click, so you should serve identical content in both cases.
The only issue is counters/analytics, but again, the server side must serve identical pages in both cases, only the browser side javascript could/should check if the page is actually viewed.