Automatically Close wordpress media uploader after click on upload image

i am using one function for automatically insert image in post after user upload image in wordpress media uploader but problem is that wordpress media uploader is still open after user upload image. so i am trying to add function that after user click on upload image after that wordpress media uploader should me close automatically.

What I am trying to do is –

  1. User clicks "Add Media"

  2. Select an image

  3. Now wordpress media uploader should be Close automatically.

any Chanches to add this type of function by php or using jquery Any clues ?