Determine if user navigated from mobile Safari

后端 未结 12 685
情书的邮戳
情书的邮戳 2020-11-29 19:40

I have an app, and I\'d like to redirect the users to different pages based on where they are navigating from.

If navigating from web clip, do not redirect. If navig

12条回答
  •  清酒与你
    2020-11-29 20:13

    this regex works for me, clean and simple

    const isIOSSafari = !!window.navigator.userAgent.match(/Version/[\d.]+.*Safari/);

提交回复
热议问题