title: Intercept download link click and prevent default download dialog
body: <p>We have built a download manager desktop application for windows. Now we want to add a feature that intercepts download links and adds them to the application. We think we should write an addon for each browser starting from Firefox.  </p>
  
  <ol>
  <li>To intercepts download links for a download manager, is writing addons the best choice?  </li>
  <li>How can we do that?  </li>
  </ol>
  
  <p>Things we've tried so far:<br>
  - Using <a href="https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Downloads.jsm#Observing_downloads" rel="nofollow noreferrer">Downloads.jsm</a> to observe new downloads, then cancel them => We don't want the user to interact with Firefox's download dialog<br>
  <a href="https://stackoverflow.com/a/24466197/2550529">https://stackoverflow.com/a/24466197/2550529</a><br>
  - Adding a click event listener to each tab and looking for links => Download links are not distinguishable.<br>
  <a href="https://stackoverflow.com/a/10345358/2550529">https://stackoverflow.com/a/10345358/2550529</a><br>
  After grabbing the link, it is just passed to our application using <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIProcess" rel="nofollow noreferrer">nsIProcess</a>.</p>
  
  <p>In one sentence: We want it to behave like IDM's new download dialog.</p>