cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philipp Kursawe <>
Subject Why does the Dialogs plugin in inject itself into navigator and has no browser support?
Date Thu, 14 Apr 2016 07:25:30 GMT

sometimes I wonder the historical reasons why certain cordova plugins
choose to inject themself into "navigator" instead of their own namespace
or remain at cordova.plugins.<pluginname>.
For things where a native browser spec exists or is proposed like
"geolocation" it makes sense. Then you can just code against the native
browser API and when running on a device, that does not have this native
support the Cordova geolocation plugin poly-fills that behaviour.

I recently came across the "Dialogs" plugin which uses
"navigator.notifications" and I wonder why?
Why not "navigator.dialogs"? So I checked, maybe there is a W3C spec for
browser notifications. There isn't.

What is also interesting, that while browser have native support for alert
and prompt at the window level, the plugin neither polyfills them nor
provides any browser support at all.

One could just write the application with "window.alert()" and on mobile
devices the plugin would polyfill this behaviour.

Any insides in the though process of those decisions?

Thanks a lot!


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