How to detect if I am in browser (local development) in Ionic 2

前端 未结 7 1224
太阳男子
太阳男子 2020-12-03 03:00

I want to make sure to launch inappbrowser only if I am on devices (iOs, Android...), but if I am in browser (local development mode or just a Web App with gulp build), I wa

7条回答
  •  死守一世寂寞
    2020-12-03 03:07

    With this you can detect if you are in a browser:

    if(window.hasOwnProperty('cordova')){ /* use webview */ }
    else { /* use browser link */ }
    

提交回复
热议问题