title: SharePoint online - intercept document request when document clicked
body: <p>I am working on this project where it includes hosted app with SharePoint online and a dozen of other things. </p>
  
  <ul>
  <li>When they built the project, they implemented a functionality that does this : </li>
  </ul>
  
  <p><em>When a user goes to a document library, and clicks on the name of a document of specific type, the user gets redirected to the hosted app where there is a logic to do something on the document.</em></p>
  
  <ul>
  <li>What I am not able to figure out is :</li>
  </ul>
  
  <p><em>How are they implementing the part of "when user clicks on document, user will be redirected to app" ?</em> </p>
  
  <p>I checked httpmodules and couldn't find anything, I also checked remote event receivers and couldn't find anything..maybe I am not searching properly in the large C# solutions they have, or maybe there is another way to implement this..I need help to figure that out.</p>