Add JS interface and Shake detection