Hey Richard,

I'm from Mozilla and my team is working on the plugins. Thanks for contributing!

I'm not extremely familiar with the battery API, but I doubt you can
change it from clobbers to merges since that affects everyone. Others
on this list need to comment on the difference there, so not sure.

I think there's a way to get the native symbol. Check out the
geolocation plugin:
https://github.com/apache/cordova-plugin-geolocation/blob/master/src/firefoxos/GeolocationProxy.js
This code gets the original geolocation object:

var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window,
'navigator.geolocation');

Try that out instead of changing config.xml.

Feel free to hop into #apps on irc.mozilla.org and we can help you out over IRC.

- James

On Sat, Feb 8, 2014 at 10:17 AM, Richard Sentino
<rich...@mindginative.com> wrote:
> Hello
>
> I started working on CB-5611 battery-status plugin for FirefoxOS [1]. I
> need help - code, comments, suggestions - before sending a PR [2].
>
> Also, a note about navigator.battery, clobbering this globally will break
> the default FirefoxOS behaviour which an object of BatteryManager [3].
> Globally setting the action to 'merges' instead of 'clobbers' seems to
> solve the issue [4] - will this worth creating a new Jira issue ?
>
> My dev environment is both Simulator and a Keon Geeksphone device running
> on B2G 1.2.0.0-prerelease.
>
> [1] https://issues.apache.org/jira/browse/CB-5611
> [2] https://github.com/rixrix/cordova-plugin-battery-status/tree/CB-5611
> [3] https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager
> [4]
> https://github.com/rixrix/cordova-plugin-battery-status/commit/83654a24eefc2ec67977ce45afd830662458465a
>
> Best,
> Richard

Reply via email to