cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Paveza <>
Subject cordova-browser platform and Hosted Web Apps: the "isSupported(feature)" function
Date Thu, 09 Apr 2015 16:26:42 GMT
I've been giving some thought to the Browser platform and hosted apps, and tightening up some
of the functionality that the Browser platform might offer when it comes to supporting W3C
things where available.  (Just as an example, I've had trouble recently with the geolocation
plugin in the browser not actually giving me data even when permitted).

I wanted to know your thoughts on the idea of creating a standard "isSupported(featureName)"
function for plugins where it would make sense.  Platforms could indicate support for a particular
function call.  The camera plugin is a great example; it's supported in browsers that have
(probably Chrome).  Rather than pivoting there on calling takePicture and having the alert
dialog pop, the use case could be to write code to conditionally show a button to take a picture
if it's supported:

if ('takePicture') {
_______ {Browse...} {Take Picture}
else {
_______ {Browse...}

There are obviously going to be cases where this doesn't make sense (the Device plugin, for
example), so I'm not suggesting that this should be on EVERY plugin.  I'm also not suggesting
that we should gate every single function behind an isSupported check.

Is there interest in anything like this?  If I started updating plugins in this vein, would
that be welcomed?


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