PhoneGap: Detect if running on desktop browser

后端 未结 30 2887
时光取名叫无心
时光取名叫无心 2020-11-29 15:47

I\'m developing a web application that uses PhoneGap:Build for a mobile version and want to have a single codebase for the \'desktop\' and mobile versions. I want to be able

30条回答
  •  没有蜡笔的小新
    2020-11-29 15:58

    None of which work, unless you remove the PhoneGap Javascript file from the desktop version of the app, which defeats my goal of having one codebase.

    Another option would be to use merges folder, see screenshot below.

    You can add platform-specific files / override default ones.

    (it should do the trick in some scenarios)

    enter image description here


    In other words: Rather than detecting the browser, you just don't include certain files for desktop build / attach certain files for iOS only.

提交回复
热议问题