Fix getting JavaScript file extension