Javascript to check if PWA or Mobile Web

前端 未结 5 1804
野的像风
野的像风 2020-12-12 12:12

I was curious if anyone knew a javascript based method for detecting whether the web experience was being run as a PWA (progressive web app) or it was simply being run as a

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-12 12:43

    In my PWA, created with Microsoft Visual Studio 2017, following statement works:

    var isPWA = navigator.userAgent.match(/MSAppHost/i);
    

提交回复
热议问题