cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brion Vibber <>
Subject Re: Determining if "you're in cordova"
Date Tue, 04 Dec 2012 20:15:08 GMT
On Dec 3, 2012 7:42 PM, "Andrew Grieve" <> wrote:
> I don't really understand using cordova.js outside of Cordova. There's one
> for every platform, so which one gets included in the web version?

In the Wikipedia app we have a single codebase for several platforms and
load the appropriate Cordova.js (if any) based on the detected user-agent.
So in a browser, we don't load any Cordova.js.

Basically what I think is needed is a way to check if we *should* load a
Cordova.js, and if so which one.

Currently we take a shortcut and assume anything on Android or iOS is
running in the Cordova app.

The primary alternative is maybe to use a build system that adds in the
platform-specific files when packaging apps, while keeping your source tree
runnable in a browser...

-- brion

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message