cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Clelland <>
Subject Re: What's the rule when determine where to attach plugin object/method to window or navigator object?
Date Mon, 14 Oct 2013 02:11:59 GMT
I can't speak officially for any of the early decisions made in the
project, but the guiding principles seem to be:

1. If possible, adhere to an existing W3C standard
(File, Storage)
2. If there is a de facto standard implemented on desktop browsers,use that
(Accelerometer, Geolocation)
3. If there is a natural mapping to a closely related desktop API, then
mimic that. (e.g, -> InAppBrowser)
4. Other plugins were generally attached to navigator (navigator.compass,
navigator.globalization, navigator.splashscreen), except for
5. A couple of APIs (e.g., Device, Media) which were assigned to window.

Custom namespaces are really just objects attached to the global window
object; that's how Media and File are defined. (In the browser, all lookups
eventually go back to window; that's just where globals live.)


On Sat, Oct 12, 2013 at 4:55 AM, Qi LUO <> wrote:

> Hi all,
> Everyone can access plugins at window or navigator object, but I’m quite
> curious that how you guys make the decision when you define a plugin? Why
> someone is on the window object but another is on the navigator object or
> any custom namespace else?
> Thanks.
> Best Regards,
> Qi LUO
> Sent with Sparrow (

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