title: Detect media files using an array with Javascript and return all the urls
body: <p>I'm trying to figure out a way to extract links for media files on any website using Javascript. I'm working with Unity3D but it's related to using uWebkit which is a Web Browser plugin, this web browser plugin allows me to inject Javascript into a site so this will (hopefully) work out.</p>
  
  <p>The purpose is to return a list of URLs for all the media links that I want the script to find (*.mp3, *.ogg, *.mp4, *.pdf etc.) which I then can click to open in a separate window with just that file in a custom video player/music player/pdf reader etc. I realize not all websites leave these in the open and I'll make a work-around for those.</p>
  
  <p>I've searched around for a script or documentation about it here, on search engines and on GitHub without success.</p>
  
  <p>PS: jQuery is fine too.</p>