If you want to add a custom menu item in Document Library’s item context menu just by Javascript without going into the details of adding any new feature or writing your own assembly then here is a quick trick: