You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Michal Mocny <mm...@google.com> on 2014/11/05 16:57:24 UTC

cordova-browser plugin polyfills -- which projects already have work in this space?

Hi All,

So there's this new cordova-browser platform thing, which is awesome.  I
wanted to get the ball rolling on full plugin support for browser platform
(thanks to Suraj Pindoria + other Adobe folk for the great work so far).

I know a bunch of people/teams have independently solved a lot of the
problems with cordova plugins not running in a browser.  E.g. Some teams
have built client libraries that do feature detection and fallback.  I know
there are some frameworks like angular that have libs for polyfilling
cordova plugins (I think Ionic may do this by default?).  And we saw
Telerik demo cordova plugin polyfills in something that already looked like
cordova-browser at PGDay.

Instead of re-inventing the wheel, please help point out such existing
solutions, and/or reach out to those devs and get them involved in
upstreaming.

Core plugins that still need implementations are:

cordova-plugin-battery-status
cordova-plugin-console
cordova-plugin-contacts
cordova-plugin-dialogs
cordova-plugin-file-transfer
cordova-plugin-file
cordova-plugin-geolocation
cordova-plugin-globalization
cordova-plugin-inappbrowser
cordova-plugin-media
cordova-plugin-media-capture
cordova-plugin-splashscreen
cordova-plugin-vibration
cordova-plugin-statusbar
cordova-plugin-test-framework

cordova-plugins/android-legacy-websql/
cordova-plugins/file-system-roots/
cordova-plugins/keyboard/
cordova-plugins/websql/

The process for implementing a browser polyfill (I'm new to this, may be
missing steps), appears to be just like any other platform whose
implementations are in js (like firefoxos, windows).  Here is the
implementation for device plugin for example:

In plugin.xml:

<!-- browser -->
    <platform name="browser">
        <config-file target="config.xml" parent="/*">
            <feature name="Device">
                <param name="browser-package" value="Device" />
            </feature>
        </config-file>

        <js-module src="src/browser/DeviceProxy.js" name="DeviceProxy">
            <runs />
        </js-module>
    </platform>

The critical bits of src/browser/DeviceProxy.js:

module.exports = {
    getDeviceInfo: function (success, error) {
        setTimeout(function () {
            success({
                cordova: browser.cordovaVersion,
                platform: getPlatform(),
                model: getModel(),
                version: getVersion(),
                uuid: null
            });
        }, 0);
    }
};

require("cordova/exec/proxy").add("Device", module.exports);

That last line is the critical bit, which signals to the bridge to forward
exec calls to these js functions for the "Device" feature.  Proxy handler
is called with (success, fail, args).

-Michal

Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Andrew Grieve <ag...@chromium.org>.
Also - I believe those APIs are available only to Chrome apps & extensions.

I do know though, that Chrome team is trying to make bluetooth on the open
web a thing: https://github.com/WebBluetoothCG/web-bluetooth. I doubt all
the access that you'd want will be available any time soon though (they are
targeting just the "safe" subset of Bluetooth).

On Fri, Nov 14, 2014 at 10:35 PM, Jesse <pu...@gmail.com> wrote:

> No. Or if it does, it won't ...
> You should use feature detection to determine if you can respond correctly
> to an API call, and/or throw a descriptive error if you cannot make it
> work.
>
> @purplecabbage
> risingj.com
>
> On Fri, Nov 14, 2014 at 1:29 PM, Don Coleman <do...@gmail.com>
> wrote:
>
> > Does the browser platform always target Chrome?
> >
> > When implementing the browser platform in a plugin can I access protected
> > chrome APIs such as
> > https://developer.chrome.com/apps/bluetooth and
> > https://developer.chrome.com/apps/bluetoothLowEnergy?
> >
> > On Fri, Nov 14, 2014 at 4:07 PM, Ray Camden <ra...@adobe.com> wrote:
> >
> > > Sorry - what I meant was - it wasn’t refreshed. It should be now and
> > > should show up when you filter to Browser.
> > >
> > > On 11/14/14, 1:44 PM, "Michal Mocny" <mm...@chromium.org> wrote:
> > >
> > > >Wasn't re-published?
> > > >
> > > >On Fri, Nov 14, 2014 at 1:08 PM, Ray Camden <ra...@adobe.com>
> wrote:
> > > >
> > > >> Ah - looks like the barcode scanner isn¹t updated yet. I know my PR
> > for
> > > >>it
> > > >> was accepted.
> > > >>
> > > >> On 11/14/14, 12:07 PM, "Ray Camden" <ra...@adobe.com> wrote:
> > > >>
> > > >> >Not sure if it was first - I added support for it to Barcode too.
> :)
> > > >> >
> > > >> >On 11/14/14, 10:34 AM, "Michal Mocny" <mm...@chromium.org> wrote:
> > > >> >
> > > >> >>Ray, thanks for adding this.
> > > >> >>
> > > >> >>Using it, I found:
> > > >> >>https://github.com/Binarypark/cordova_app_version_plugin
> > > >> >>which is the first non-core plugin to claim browser support :)
> > > >> >>
> > > >> >>(which, by the way, is both crazy that it required a plugin and
> > > >>awesome
> > > >> >>that someone wrote the feature as a small trivial plugin and
> shared
> > > >>with
> > > >> >>the world).
> > > >> >>
> > > >> >>-Michal
> > > >> >>
> > > >> >>O
> > > >> >
> > > >> >
> > > >>
> >---------------------------------------------------------------------
> > > >> >To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> > > >> >For additional commands, e-mail: dev-help@cordova.apache.org
> > > >> >
> > > >>
> > > >>
> > > >>
> ---------------------------------------------------------------------
> > > >> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> > > >> For additional commands, e-mail: dev-help@cordova.apache.org
> > > >>
> > > >>
> > >
> > >
> >
>

Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Jesse <pu...@gmail.com>.
No. Or if it does, it won't ...
You should use feature detection to determine if you can respond correctly
to an API call, and/or throw a descriptive error if you cannot make it work.

@purplecabbage
risingj.com

On Fri, Nov 14, 2014 at 1:29 PM, Don Coleman <do...@gmail.com> wrote:

> Does the browser platform always target Chrome?
>
> When implementing the browser platform in a plugin can I access protected
> chrome APIs such as
> https://developer.chrome.com/apps/bluetooth and
> https://developer.chrome.com/apps/bluetoothLowEnergy?
>
> On Fri, Nov 14, 2014 at 4:07 PM, Ray Camden <ra...@adobe.com> wrote:
>
> > Sorry - what I meant was - it wasn’t refreshed. It should be now and
> > should show up when you filter to Browser.
> >
> > On 11/14/14, 1:44 PM, "Michal Mocny" <mm...@chromium.org> wrote:
> >
> > >Wasn't re-published?
> > >
> > >On Fri, Nov 14, 2014 at 1:08 PM, Ray Camden <ra...@adobe.com> wrote:
> > >
> > >> Ah - looks like the barcode scanner isn¹t updated yet. I know my PR
> for
> > >>it
> > >> was accepted.
> > >>
> > >> On 11/14/14, 12:07 PM, "Ray Camden" <ra...@adobe.com> wrote:
> > >>
> > >> >Not sure if it was first - I added support for it to Barcode too. :)
> > >> >
> > >> >On 11/14/14, 10:34 AM, "Michal Mocny" <mm...@chromium.org> wrote:
> > >> >
> > >> >>Ray, thanks for adding this.
> > >> >>
> > >> >>Using it, I found:
> > >> >>https://github.com/Binarypark/cordova_app_version_plugin
> > >> >>which is the first non-core plugin to claim browser support :)
> > >> >>
> > >> >>(which, by the way, is both crazy that it required a plugin and
> > >>awesome
> > >> >>that someone wrote the feature as a small trivial plugin and shared
> > >>with
> > >> >>the world).
> > >> >>
> > >> >>-Michal
> > >> >>
> > >> >>O
> > >> >
> > >> >
> > >> >---------------------------------------------------------------------
> > >> >To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> > >> >For additional commands, e-mail: dev-help@cordova.apache.org
> > >> >
> > >>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> > >> For additional commands, e-mail: dev-help@cordova.apache.org
> > >>
> > >>
> >
> >
>

Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Don Coleman <do...@gmail.com>.
Does the browser platform always target Chrome?

When implementing the browser platform in a plugin can I access protected
chrome APIs such as
https://developer.chrome.com/apps/bluetooth and
https://developer.chrome.com/apps/bluetoothLowEnergy?

On Fri, Nov 14, 2014 at 4:07 PM, Ray Camden <ra...@adobe.com> wrote:

> Sorry - what I meant was - it wasn’t refreshed. It should be now and
> should show up when you filter to Browser.
>
> On 11/14/14, 1:44 PM, "Michal Mocny" <mm...@chromium.org> wrote:
>
> >Wasn't re-published?
> >
> >On Fri, Nov 14, 2014 at 1:08 PM, Ray Camden <ra...@adobe.com> wrote:
> >
> >> Ah - looks like the barcode scanner isn¹t updated yet. I know my PR for
> >>it
> >> was accepted.
> >>
> >> On 11/14/14, 12:07 PM, "Ray Camden" <ra...@adobe.com> wrote:
> >>
> >> >Not sure if it was first - I added support for it to Barcode too. :)
> >> >
> >> >On 11/14/14, 10:34 AM, "Michal Mocny" <mm...@chromium.org> wrote:
> >> >
> >> >>Ray, thanks for adding this.
> >> >>
> >> >>Using it, I found:
> >> >>https://github.com/Binarypark/cordova_app_version_plugin
> >> >>which is the first non-core plugin to claim browser support :)
> >> >>
> >> >>(which, by the way, is both crazy that it required a plugin and
> >>awesome
> >> >>that someone wrote the feature as a small trivial plugin and shared
> >>with
> >> >>the world).
> >> >>
> >> >>-Michal
> >> >>
> >> >>O
> >> >
> >> >
> >> >---------------------------------------------------------------------
> >> >To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> >> >For additional commands, e-mail: dev-help@cordova.apache.org
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> >> For additional commands, e-mail: dev-help@cordova.apache.org
> >>
> >>
>
>

Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Ray Camden <ra...@adobe.com>.
Sorry - what I meant was - it wasn’t refreshed. It should be now and
should show up when you filter to Browser.

On 11/14/14, 1:44 PM, "Michal Mocny" <mm...@chromium.org> wrote:

>Wasn't re-published?
>
>On Fri, Nov 14, 2014 at 1:08 PM, Ray Camden <ra...@adobe.com> wrote:
>
>> Ah - looks like the barcode scanner isn¹t updated yet. I know my PR for
>>it
>> was accepted.
>>
>> On 11/14/14, 12:07 PM, "Ray Camden" <ra...@adobe.com> wrote:
>>
>> >Not sure if it was first - I added support for it to Barcode too. :)
>> >
>> >On 11/14/14, 10:34 AM, "Michal Mocny" <mm...@chromium.org> wrote:
>> >
>> >>Ray, thanks for adding this.
>> >>
>> >>Using it, I found:
>> >>https://github.com/Binarypark/cordova_app_version_plugin
>> >>which is the first non-core plugin to claim browser support :)
>> >>
>> >>(which, by the way, is both crazy that it required a plugin and
>>awesome
>> >>that someone wrote the feature as a small trivial plugin and shared
>>with
>> >>the world).
>> >>
>> >>-Michal
>> >>
>> >>O
>> >
>> >
>> >---------------------------------------------------------------------
>> >To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>> >For additional commands, e-mail: dev-help@cordova.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>> For additional commands, e-mail: dev-help@cordova.apache.org
>>
>>


Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Michal Mocny <mm...@chromium.org>.
Wasn't re-published?

On Fri, Nov 14, 2014 at 1:08 PM, Ray Camden <ra...@adobe.com> wrote:

> Ah - looks like the barcode scanner isn¹t updated yet. I know my PR for it
> was accepted.
>
> On 11/14/14, 12:07 PM, "Ray Camden" <ra...@adobe.com> wrote:
>
> >Not sure if it was first - I added support for it to Barcode too. :)
> >
> >On 11/14/14, 10:34 AM, "Michal Mocny" <mm...@chromium.org> wrote:
> >
> >>Ray, thanks for adding this.
> >>
> >>Using it, I found:
> >>https://github.com/Binarypark/cordova_app_version_plugin
> >>which is the first non-core plugin to claim browser support :)
> >>
> >>(which, by the way, is both crazy that it required a plugin and awesome
> >>that someone wrote the feature as a small trivial plugin and shared with
> >>the world).
> >>
> >>-Michal
> >>
> >>O
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> >For additional commands, e-mail: dev-help@cordova.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>

Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Ray Camden <ra...@adobe.com>.
Ah - looks like the barcode scanner isn¹t updated yet. I know my PR for it
was accepted.

On 11/14/14, 12:07 PM, "Ray Camden" <ra...@adobe.com> wrote:

>Not sure if it was first - I added support for it to Barcode too. :)
>
>On 11/14/14, 10:34 AM, "Michal Mocny" <mm...@chromium.org> wrote:
>
>>Ray, thanks for adding this.
>>
>>Using it, I found:
>>https://github.com/Binarypark/cordova_app_version_plugin
>>which is the first non-core plugin to claim browser support :)
>>
>>(which, by the way, is both crazy that it required a plugin and awesome
>>that someone wrote the feature as a small trivial plugin and shared with
>>the world).
>>
>>-Michal
>>
>>O
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>For additional commands, e-mail: dev-help@cordova.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Ray Camden <ra...@adobe.com>.
Not sure if it was first - I added support for it to Barcode too. :)

On 11/14/14, 10:34 AM, "Michal Mocny" <mm...@chromium.org> wrote:

>Ray, thanks for adding this.
>
>Using it, I found:
>https://github.com/Binarypark/cordova_app_version_plugin
>which is the first non-core plugin to claim browser support :)
>
>(which, by the way, is both crazy that it required a plugin and awesome
>that someone wrote the feature as a small trivial plugin and shared with
>the world).
>
>-Michal
>
>O


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Michal Mocny <mm...@chromium.org>.
Ray, thanks for adding this.

Using it, I found: https://github.com/Binarypark/cordova_app_version_plugin
which is the first non-core plugin to claim browser support :)

(which, by the way, is both crazy that it required a plugin and awesome
that someone wrote the feature as a small trivial plugin and shared with
the world).

-Michal

On Tue, Nov 11, 2014 at 10:00 AM, Ray Camden <ra...@adobe.com> wrote:

> This went live yesterday. Let me know if it doesn¹t work for you.
>
>
> On 11/5/14, 11:02 AM, "Victor Sosa" <so...@gmail.com> wrote:
>
> >Good point, Michal. It would be nice if we could browse the plugins by
> >just
> >filtering the platform.
> >
> >2014-11-05 10:53 GMT-06:00 Michal Mocny <mm...@chromium.org>:
> >
> >> Cool!  But I can't find how to do this with "browse all plugins".
> >>Appears
> >> to be a filter option on search results but cannot search for * or . --
> >>and
> >> the filter doesn't persist nor alter url for linkability.
> >>
> >> -Michal
> >>
> >> On Wed, Nov 5, 2014 at 11:46 AM, Ray Camden <ra...@adobe.com> wrote:
> >>
> >> > As just an FYI, plugins.cordova.io can now filter to plugins that
> >> support
> >> > browser as a platform. This could be used to figure out what plugins
> >>have
> >> > added support.
> >> >
> >> >
> >> >
> >> > On 11/5/14, 9:57 AM, "Michal Mocny" <mm...@google.com> wrote:
> >> >
> >> > >The process for implementing a browser polyfill (I'm new to this,
> >>may be
> >> > >missing steps), appears to be just like any other platform whose
> >> > >implementations are in js (like firefoxos, windows).  Here is the
> >> > >implementation for device plugin for example:
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> >> > For additional commands, e-mail: dev-help@cordova.apache.org
> >> >
> >> >
> >>
> >
> >
> >
> >--
> >Victor Adrian Sosa Herrera
> >IBM Software Engineer
> >Guadalajara, Jalisco
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>

Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Ray Camden <ra...@adobe.com>.
This went live yesterday. Let me know if it doesn¹t work for you.


On 11/5/14, 11:02 AM, "Victor Sosa" <so...@gmail.com> wrote:

>Good point, Michal. It would be nice if we could browse the plugins by
>just
>filtering the platform.
>
>2014-11-05 10:53 GMT-06:00 Michal Mocny <mm...@chromium.org>:
>
>> Cool!  But I can't find how to do this with "browse all plugins".
>>Appears
>> to be a filter option on search results but cannot search for * or . --
>>and
>> the filter doesn't persist nor alter url for linkability.
>>
>> -Michal
>>
>> On Wed, Nov 5, 2014 at 11:46 AM, Ray Camden <ra...@adobe.com> wrote:
>>
>> > As just an FYI, plugins.cordova.io can now filter to plugins that
>> support
>> > browser as a platform. This could be used to figure out what plugins
>>have
>> > added support.
>> >
>> >
>> >
>> > On 11/5/14, 9:57 AM, "Michal Mocny" <mm...@google.com> wrote:
>> >
>> > >The process for implementing a browser polyfill (I'm new to this,
>>may be
>> > >missing steps), appears to be just like any other platform whose
>> > >implementations are in js (like firefoxos, windows).  Here is the
>> > >implementation for device plugin for example:
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>> > For additional commands, e-mail: dev-help@cordova.apache.org
>> >
>> >
>>
>
>
>
>-- 
>Victor Adrian Sosa Herrera
>IBM Software Engineer
>Guadalajara, Jalisco


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Victor Sosa <so...@gmail.com>.
Good point, Michal. It would be nice if we could browse the plugins by just
filtering the platform.

2014-11-05 10:53 GMT-06:00 Michal Mocny <mm...@chromium.org>:

> Cool!  But I can't find how to do this with "browse all plugins".  Appears
> to be a filter option on search results but cannot search for * or . -- and
> the filter doesn't persist nor alter url for linkability.
>
> -Michal
>
> On Wed, Nov 5, 2014 at 11:46 AM, Ray Camden <ra...@adobe.com> wrote:
>
> > As just an FYI, plugins.cordova.io can now filter to plugins that
> support
> > browser as a platform. This could be used to figure out what plugins have
> > added support.
> >
> >
> >
> > On 11/5/14, 9:57 AM, "Michal Mocny" <mm...@google.com> wrote:
> >
> > >The process for implementing a browser polyfill (I'm new to this, may be
> > >missing steps), appears to be just like any other platform whose
> > >implementations are in js (like firefoxos, windows).  Here is the
> > >implementation for device plugin for example:
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> > For additional commands, e-mail: dev-help@cordova.apache.org
> >
> >
>



-- 
Victor Adrian Sosa Herrera
IBM Software Engineer
Guadalajara, Jalisco

RE: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by "Parashuram Narasimhan (MS OPEN TECH)" <pa...@microsoft.com>.
We have started working on porting some of the plugins to the browser platform. I think we should add JIRA work items for each, and assign to ourselves, if we are starting to work on a plugin to ensure that we don't have 2 folks working on the same plugin :) 

-----Original Message-----
From: Suraj Pindoria [mailto:suraj.pindoria@yahoo.com.INVALID] 
Sent: Wednesday, November 5, 2014 10:07 AM
To: dev@cordova.apache.org
Subject: Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Just an FYI that geolocation does work in the browser.  I tested this over the summer and all the major browsers already have support for it.

Suraj.

> On Nov 5, 2014, at 9:35 AM, Ray Camden <ra...@adobe.com> wrote:
> 
> Hmpth - let me look into that post lunch.
> 
> On 11/5/14, 10:53 AM, "Michal Mocny" <mm...@chromium.org> wrote:
> 
>> Cool!  But I can't find how to do this with "browse all plugins".  
>> Appears to be a filter option on search results but cannot search for 
>> * or . -- and the filter doesn't persist nor alter url for 
>> linkability.
>> 
>> -Michal
>> 
>> On Wed, Nov 5, 2014 at 11:46 AM, Ray Camden <ra...@adobe.com> wrote:
>> 
>>> As just an FYI, plugins.cordova.io can now filter to plugins that 
>>> support browser as a platform. This could be used to figure out what 
>>> plugins have added support.
>>> 
>>> 
>>> 
>>> On 11/5/14, 9:57 AM, "Michal Mocny" <mm...@google.com> wrote:
>>> 
>>>> The process for implementing a browser polyfill (I'm new to this, 
>>>> may
>>> be
>>>> missing steps), appears to be just like any other platform whose 
>>>> implementations are in js (like firefoxos, windows).  Here is the 
>>>> implementation for device plugin for example:
>>> 
>>> 
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>>> For additional commands, e-mail: dev-help@cordova.apache.org
>>> 
>>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Suraj Pindoria <su...@yahoo.com.INVALID>.
Just an FYI that geolocation does work in the browser.  I tested this over the summer and all the major browsers already have support for it.

Suraj.

> On Nov 5, 2014, at 9:35 AM, Ray Camden <ra...@adobe.com> wrote:
> 
> Hmpth - let me look into that post lunch.
> 
> On 11/5/14, 10:53 AM, "Michal Mocny" <mm...@chromium.org> wrote:
> 
>> Cool!  But I can't find how to do this with "browse all plugins".  Appears
>> to be a filter option on search results but cannot search for * or . --
>> and
>> the filter doesn't persist nor alter url for linkability.
>> 
>> -Michal
>> 
>> On Wed, Nov 5, 2014 at 11:46 AM, Ray Camden <ra...@adobe.com> wrote:
>> 
>>> As just an FYI, plugins.cordova.io can now filter to plugins that
>>> support
>>> browser as a platform. This could be used to figure out what plugins
>>> have
>>> added support.
>>> 
>>> 
>>> 
>>> On 11/5/14, 9:57 AM, "Michal Mocny" <mm...@google.com> wrote:
>>> 
>>>> The process for implementing a browser polyfill (I'm new to this, may
>>> be
>>>> missing steps), appears to be just like any other platform whose
>>>> implementations are in js (like firefoxos, windows).  Here is the
>>>> implementation for device plugin for example:
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>>> For additional commands, e-mail: dev-help@cordova.apache.org
>>> 
>>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Ray Camden <ra...@adobe.com>.
Hmpth - let me look into that post lunch.

On 11/5/14, 10:53 AM, "Michal Mocny" <mm...@chromium.org> wrote:

>Cool!  But I can't find how to do this with "browse all plugins".  Appears
>to be a filter option on search results but cannot search for * or . --
>and
>the filter doesn't persist nor alter url for linkability.
>
>-Michal
>
>On Wed, Nov 5, 2014 at 11:46 AM, Ray Camden <ra...@adobe.com> wrote:
>
>> As just an FYI, plugins.cordova.io can now filter to plugins that
>>support
>> browser as a platform. This could be used to figure out what plugins
>>have
>> added support.
>>
>>
>>
>> On 11/5/14, 9:57 AM, "Michal Mocny" <mm...@google.com> wrote:
>>
>> >The process for implementing a browser polyfill (I'm new to this, may
>>be
>> >missing steps), appears to be just like any other platform whose
>> >implementations are in js (like firefoxos, windows).  Here is the
>> >implementation for device plugin for example:
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>> For additional commands, e-mail: dev-help@cordova.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Michal Mocny <mm...@chromium.org>.
Cool!  But I can't find how to do this with "browse all plugins".  Appears
to be a filter option on search results but cannot search for * or . -- and
the filter doesn't persist nor alter url for linkability.

-Michal

On Wed, Nov 5, 2014 at 11:46 AM, Ray Camden <ra...@adobe.com> wrote:

> As just an FYI, plugins.cordova.io can now filter to plugins that support
> browser as a platform. This could be used to figure out what plugins have
> added support.
>
>
>
> On 11/5/14, 9:57 AM, "Michal Mocny" <mm...@google.com> wrote:
>
> >The process for implementing a browser polyfill (I'm new to this, may be
> >missing steps), appears to be just like any other platform whose
> >implementations are in js (like firefoxos, windows).  Here is the
> >implementation for device plugin for example:
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>

Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Ray Camden <ra...@adobe.com>.
As just an FYI, plugins.cordova.io can now filter to plugins that support
browser as a platform. This could be used to figure out what plugins have
added support.



On 11/5/14, 9:57 AM, "Michal Mocny" <mm...@google.com> wrote:

>The process for implementing a browser polyfill (I'm new to this, may be
>missing steps), appears to be just like any other platform whose
>implementations are in js (like firefoxos, windows).  Here is the
>implementation for device plugin for example:


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: cordova-browser plugin polyfills -- which projects already have work in this space?

Posted by Andrew Grieve <ag...@chromium.org>.
On Wed, Nov 5, 2014 at 10:57 AM, Michal Mocny <mm...@google.com> wrote:

> Hi All,
>
> So there's this new cordova-browser platform thing, which is awesome.  I
> wanted to get the ball rolling on full plugin support for browser platform
> (thanks to Suraj Pindoria + other Adobe folk for the great work so far).
>
> I know a bunch of people/teams have independently solved a lot of the
> problems with cordova plugins not running in a browser.  E.g. Some teams
> have built client libraries that do feature detection and fallback.  I know
> there are some frameworks like angular that have libs for polyfilling
> cordova plugins (I think Ionic may do this by default?).  And we saw
> Telerik demo cordova plugin polyfills in something that already looked like
> cordova-browser at PGDay.
>
> Instead of re-inventing the wheel, please help point out such existing
> solutions, and/or reach out to those devs and get them involved in
> upstreaming.
>
> Core plugins that still need implementations are:
>
> cordova-plugin-battery-status
> cordova-plugin-console
> cordova-plugin-contacts
> cordova-plugin-dialogs
> cordova-plugin-file-transfer
> cordova-plugin-file
> cordova-plugin-geolocation
> cordova-plugin-globalization
> cordova-plugin-inappbrowser
> cordova-plugin-media
> cordova-plugin-media-capture
> cordova-plugin-splashscreen
> cordova-plugin-vibration
> cordova-plugin-statusbar
> cordova-plugin-test-framework
>
> cordova-plugins/android-legacy-websql/
> cordova-plugins/file-system-roots/
> cordova-plugins/keyboard/
> cordova-plugins/websql/
>
Just deleted all but keyboard here (within cordova-plugins) as they are
obsolete.


>
> The process for implementing a browser polyfill (I'm new to this, may be
> missing steps), appears to be just like any other platform whose
> implementations are in js (like firefoxos, windows).  Here is the
> implementation for device plugin for example:
>
> In plugin.xml:
>
> <!-- browser -->
>     <platform name="browser">
>         <config-file target="config.xml" parent="/*">
>             <feature name="Device">
>                 <param name="browser-package" value="Device" />
>             </feature>
>         </config-file>
>
>         <js-module src="src/browser/DeviceProxy.js" name="DeviceProxy">
>             <runs />
>         </js-module>
>     </platform>
>
> The critical bits of src/browser/DeviceProxy.js:
>
> module.exports = {
>     getDeviceInfo: function (success, error) {
>         setTimeout(function () {
>             success({
>                 cordova: browser.cordovaVersion,
>                 platform: getPlatform(),
>                 model: getModel(),
>                 version: getVersion(),
>                 uuid: null
>             });
>         }, 0);
>     }
> };
>
> require("cordova/exec/proxy").add("Device", module.exports);
>
> That last line is the critical bit, which signals to the bridge to forward
> exec calls to these js functions for the "Device" feature.  Proxy handler
> is called with (success, fail, args).
>
> -Michal
>