檢查支援

檢查瀏覽器是否支援振動

if ('vibrate' in window.navigator)
    // browser has support for vibrations
else
    // no support