I think we could do 
if (vibration) {
  window.navigator.vibrate(200);
}

and remove all the other vibrate call in this file. Otherwise you will get unstable vibration call counts.