Browser as a platform for your PhoneGap/Cordova apps

This post is more than 2 years old.

Over a year later and this blog post is still highly popular. If you like this content, be sure to subscribe to the blog to get the latest updates. You may also want to check out my Apache Cordova book and the JavaScript videos I have available.

This is a pretty exciting change. If you've recently updated to the latest version of Cordova, you will notice that a new platform exists: browser. What exactly does this mean? It means the browser is now (well, becoming) a viable way to test your PhoneGap/Cordova applications. For a long time now I've done a lot of my development in the browser. Most of the time I'm not concerned about some random Cordova feature, instead I'm more concerned about something else. So I'll skip, or mock, a Cordova feature and focus on the important stuff. But eventually I hit that point where I need to do something via a core plugin and then I leave the desktop. Now we have an alternative.

Plugins currently ship with code for each of their supported platforms. This means that for a plugin to support Cowbell (random example) it ships code for Android, iOS, and whatever other platform it wants to support. They ship a standard JavaScript interface so your use of the code "just works" across platforms. (To be clear, there are quirks sometimes, and most plugins do a good job of documenting this.)

With the addition of "Browser" as a platform, a plugin can write code to support running under a desktop environment. How it does this is completely up to the plugin. As an example, the Barcode scanner plugin could simply return a hard coded barcode value.

As an additional change, when you run the browser platform, the deviceready event will automatically fire. Normally when I'm running on the desktop I add a line of code to fake it until I switch to a device, but now I can skip it. So how does it work?

First and foremost - there are some bugs with the implementation right now. These are going away soon. Keep that in mind if you are reading this in the future. (How did the iPad 5 Plus turn out?)

To begin, you need to add browser as a platform. However, you cannot do the normal cordova platform add browser. Instead, use the --usegit flag, like so: cordova platform add browser --usegit. As I warned above, this is one of those bugs that will go away soon.

To run your application in the browser, you must close Chrome. Completely. Why? Because currently the CLI has to start Chrome with a few flags attached. So kill Chrome, and then type: cordova run browser. This will open up Chrome and point it at your application. You will see a warning about the flags it added but you can ignore those.

The next issue is updating. If you edit your code and run cordova run browser again, Chrome will become focused, but will not reload. Nor will it select the tab with your application if you happened to switch it. So just select the tab (if changed) and click reload.

So to be clear, the process is - do the run at the CLI, let Chrome focus, and just hit reload. Again, this can, and will, become better.

Alright - now that you can test it, what's supported? I checked the core plugins only, but here are the plugins with browser as a platform support:

  • Camera
  • Device
  • Device Motion (Accelerometer)
  • Device Orientation (Compass)
  • Network Information

I then worked on a sample application that would let me test how these guys react in the browser environment. Here is that report. (As the sample app just runs the standard APIs, I didn't bother attaching the code to the blog post, but if anyone wants it, just ask.)

Camera

Everything works as you would expect except that you can only use base64 strings for the captured image, not file URIs. This is documented but as the docs suggest you normally should use file URIs, so keep it in mind. My demo application used two buttons, one to ask for a new image from the camera and one for an image from the photo gallery. When you try to select an image from the camera, the plugin makes use of your web cam.

After you grant permission, the plugin adds a little video output screen to the page and lets you select an image.

Finally, when you click capture, the base64 data is transmitted back to your success handler and you can add it to the DOM.

If you select to use an image from the photo gallery, the plugin just makes use of a file picker.

Cool - so the only real oddity is that the webcam version also uses your mic. When I tested I got some weird feedback. I've already filed a bug for the plugin to simply skip the mic. There really isn't any use for it. (But the Media Capture plugin could certainly use it.)

Device

For Device, it simply sniffs the browser and uses some sensible defaults. I kinda wish Chrome would pretend to be Android, or maybe even iOS. I wrote code to simply dump out the device object to the console. Here is that result.

Device Motion (Accelerometer)

Using this API will simply return random data. It will not integrate with Chrome's DevTools Accelerometer tester, which is unfortunate, but I can live without it. Both the getCurrent and watch APIs work as expected, although I noticed a bit of delay in the watch version. I did not see this in the orientation plugin. Here is a screen shot.

Device Orientation (Compass)

Yep, just repeat what I said above. Random data. The only real difference is that the watch interval seemed to be perfectly in sync. Again, a screen shot.

Conclusion

So - all in all - this is a pretty exciting change. I hope more plugin authors adopt this platform and add support for it. (In fact, I'd consider it required but that's just me.) I should point out that the PhoneGap CLI does not support this platform yet.

Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Archived Comments

Comment 1 by Martin Cisneros posted on 9/25/2014 at 2:54 AM

"I should point out that the PhoneGap CLI does not support this platform yet". Maybe this is the line to separate Phonegap and continue just with Cordova

Comment 2 by Martin Cisneros posted on 9/25/2014 at 3:18 AM

I got cordova 3.6.3-0.2.13 and when i try cordova platform add browser it send me this message:

Unable to fetch platform browser: Error: No compatible version found: cordova-broser@'master'
Valid install tarjets:
3.5.0,3.5.1,3.5.2

Just waiting for an update :)

Comment 3 by Raymond Camden posted on 9/25/2014 at 4:08 AM

Martin - read my blog post again. I explain how to get around that.

Comment 4 by Trev posted on 9/25/2014 at 5:42 AM

This will save a lot of time and mocking.
Thanks

Comment 5 by Michal Mocny posted on 9/25/2014 at 7:19 PM

Great article Ray, I have fallen behind tracking progress on browser platform.

In case you are working on it, or know who is, you can fix the "need to shut down chrome" problem by passing --user-data-dir=some_temp_dir. Chrome process is a singleton only per user profile, so by creating a new profile you can start with new command line flags applied. (This strategy is often also used by chrome devs to make sure the browser is in a clean state.)

I tried to write a patch for the cordova-browser run script, but someone its use of "open -a" is making the user-data-dir argument not apply. I think perhaps open command using its own internal magic to bring the process into the foreground if its already running.. If I instead run "Applications/Google\ Chrome.app/Contents/MacOS/G...\ Chrome --user-data-dir=test --disable-web-security" it works.

If you aren't working on this, let me know and I'll just open PR for the repo.

Comment 6 by Raymond Camden posted on 9/25/2014 at 7:23 PM

When you say pass so and so (and my blog auto formats comments a bit so I apologize it munged it a bit) are you saying pass it to the cordova run message?

And no - I'm a Cordova user and pretend evangelist, I don't hack on the source itself. I'm sure they would love a PR. :)

Comment 7 by Michal Mocny posted on 9/25/2014 at 7:32 PM

Some more details..

Seems open has a '-n' which will open a fresh application instead of bringing to front, resolving the previous issue. However now I get auth errors with my user-data-dir (perhaps open runs commands under a different user?), and /dev/null is apparently no longer a valid user-data-dir and silently fails.

If I pre-create a user-dir with chmod 1777, then it works fine. Likely there is an even easier alternative by just modifying the flags to open command, but I cannot find it.

Comment 8 by Michal Mocny posted on 9/25/2014 at 7:43 PM

Ray, I meant we should update the run script within the cordova-browser repo so that users don't have to kill Chrome first.

I've resolved the permissions issue by just hardcoding to use a profile in /tmp/ and opened a PR for it here: https://github.com/apache/c...

Only tested on Mac, but I think that is true for the current run script, too.

Comment 9 by Joe Dev posted on 9/25/2014 at 7:44 PM

Out of curiosity, how does this compare with ripple-emulator that I am using currently?

Comment 10 by Raymond Camden posted on 9/25/2014 at 7:49 PM

@Michal: Got ya.

@Joe: Good question. So - Ripple has been a bit quiet lately. I'm on the dev list (and a contributor), and there was some recent activity around Cordova 3.6.3, but in general, not much is going on. I'd like to spend more time on it, but honestly, I just don't have it. It does have the advantage of creating a visual wrapper around your web view, and while it is fake, it makes it feel a bit more real. You can fake the accelerometer a bit better (with data you specify I mean). It also has better localization support (you can switch to French I believe). Also, you could test changing network stuff via the UI.

In general, Ripple has some nicer controls on top of the mocking - if that makes sense. As a project though I don't know how much further it will be developed.

The *ideal* solution, maybe, would be for Ripple to remove it's own mocking stuff and make use of the mocking here, and just provide the nice UI/control type stuff.

Comment 11 by Michal Mocny posted on 9/25/2014 at 7:54 PM

Ray, have you tried Chrome Dev Tools mobile emulation for the UI stuff? https://developer.chrome.co...

Not sure that it replaces everything ripple did, but it also adds a lot of new awesome. Combined with browser-platform polyfills, I think we are pretty set..

Comment 12 by Raymond Camden posted on 9/25/2014 at 7:56 PM

I have. I think I mentioned it above in terms of the accelerometer. It's nice. Ripple is a bit better - especially for GPS. (They let you select from a map instead of just entering long/lat points which no one really knows off the top of their head. :)

As a completely OT note - their network emulation is bad though. If you try to use it to change network conditions or go offline, they don't fire the appropriate offline/online events. I need to blog about that bug.

Comment 13 by Raymond Camden posted on 9/25/2014 at 8:11 PM
Comment 14 by Martin Cisneros posted on 9/26/2014 at 10:47 AM

Thank you Raymond!

Comment 15 by Michal Mocny posted on 9/26/2014 at 9:21 PM

Ray, cordova-browser run script has been updated. If you re-add the browser platform from git, you should not need to kill your primary chrome instance any more.

Comment 16 by Raymond Camden posted on 9/26/2014 at 10:18 PM

I normally just update my main cordova CLI. Is this something I'd do separate w/ npm?

Comment 17 by Daniel G posted on 9/26/2014 at 11:03 PM

I updated cordova and added the browser platform. It builds fine, but when I run `cordova run browser` I get a cryptic fail error: ENOENT. Any ideas?

Comment 18 by Raymond Camden posted on 9/26/2014 at 11:34 PM

@Daniel: Sorry, no. Sounds familiar. Maybe remove/add it back?

Comment 19 by Daniel G posted on 9/26/2014 at 11:43 PM

I tried that already, it did nothing. I guess I'll just use Weinre.

Comment 20 by Raymond Camden posted on 9/26/2014 at 11:55 PM

Oh lord no - if you want to debug, use Chrome Remote Debug or Safari Remote Debug. Or see my article on GapDebug.

Comment 21 by Ilya Buziuk posted on 10/3/2014 at 4:18 PM

Hello, Raymond.
What do you think about "Ripple as a platform" idea? Ripple has almost all core plugin functionality + sexy UI.
P.S I also faced ENOENT error on windows

Comment 22 by Raymond Camden posted on 10/5/2014 at 12:39 AM

I like Ripple and used to use it a lot. I'm even a contributor. But this feels like a better approach. This also doesn't make Ripple obsolete. In my mind, I think Ripple provides a cooler UI and could be modified to use plugins like this does.

Basically - what i said to Michal above. :)

Comment 23 by Levi L posted on 10/9/2014 at 7:25 PM

Hi Ray,
I might be missing a step in your post, but when I try to run the command: _cordova platform add browser --usegit_, I get a _TypeError: Cannot read property 'text' of null_ error. I made sure that Chrome was not running and readding/removing the platform does not seem to fix the issue. Any ideas why this is happening?

Comment 24 by Raymond Camden posted on 10/9/2014 at 7:27 PM

Hmm, no, sorry, I don't. Best I can suggest is to file a bug report.

Comment 25 by Levi L posted on 10/9/2014 at 8:02 PM

Figured out the issue. Our config.xml file was missing the description tag, which was causing the cli to crash. After adding that in it worked fine. Thanks for posting this, excited to use this in our development process.

Comment 26 by Eliot Sykes posted on 10/20/2014 at 1:44 PM

Hi Raymond - Thank you for this, this is good news. How's support for other browsers?

Comment 27 by Mte90 posted on 10/20/2014 at 5:05 PM

Any news for support for other browser?
Support for generate an Open Web App (https://developer.mozilla.o... for Firefox/Firefox for Android?

Comment 28 by Babak posted on 10/20/2014 at 10:44 PM

I'm running Cordova on Windows 7 with Chrome 38.0.2125.101 m.
Android version works fine but I got following error on Browser.
Any idea?

>*cordova run browser*
Running command: cmd "/s /c ""d:\..\platforms\browser\cordova\run.bat"""

*events.js:72*
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1001:11)
at Process.ChildProcess._handle.onexit (child_process.js:792:34)
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone (C:\...\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)

Comment 29 by Raymond Camden posted on 10/22/2014 at 1:03 AM

@eliot/@mte90 - I only tested in Chrome, but honestly I don't think the code is Chrome specific in terms of the mock portion. I think it's just Chrome specific in how it *launches*. I wrote brwoser support for the Barcode Scanner plugin and my code just uses a simple prompt/confirm. Unfortunately the other hasn't approved it yet.

Comment 30 by Raymond Camden posted on 10/22/2014 at 1:04 AM

@babak: I can't fire up a VM at the moment. Ensure you are updated to latest (4.0) and if you still see it, file a bug report.

Comment 31 by Alan Zhu posted on 10/22/2014 at 9:27 PM

Hi Raymond and babak,

I got the same error as you. "Error: spawn ENOENT".
After checking codes, I found the root cause and the temp solution.

Root cause: The javascript file “run” in <project>/platforms/browser/ hardcodes the path of “chrome.exe”.

Solution: run chrome.exe directly or change the above file to include the correct path.

>chrome.exe --user-data-dir="C:/Chromedevsession --disable-web-security

then open file <project_path>/platforms/browser/www/index.html directly.

for details, please refer to http://alanzhu.cn/blog/?p=64

BTW: up to now, I only run the basic example without camera etc.

Comment 32 by Raymond Camden posted on 10/23/2014 at 12:46 AM

Alan, thank you very much for sharing that!

Comment 33 by Babak posted on 10/23/2014 at 9:53 AM

Thanks to Alan my problem has been solved. Thank you to you, too, Raymond.

Comment 34 by Marc Luria posted on 11/26/2014 at 10:01 AM

After I do cordova run browser it opens up a new browser window in chrome. However, localstorage doesn't seem to work, i.e. it forgot everything from the last time. Sort of like incongnito mode.

Any fix to this?

Comment 35 (In reply to #34) by Raymond Camden posted on 11/26/2014 at 8:18 PM

On OSX I'm not able to replicate this. I just did a quick test and LS persisted.

Comment 36 by Marek Dąbrowski posted on 11/28/2014 at 7:51 PM

Just a note. I had to change the command slightly to make it work on the linux box:
cordova platform add browser@master --usegit

Comment 37 by Colin Bowern posted on 12/5/2014 at 11:01 AM

Any plans to update "phonegap serve" and the underlying cordova piece to serve up the browser version of cordova.js file instead of android cordova.js when using Google Chrome over HTTP? I am trying to use protractor to drive system tests using an http location instead of having to mash together a file path is a lot cleaner.

Comment 38 (In reply to #37) by Raymond Camden posted on 12/5/2014 at 7:15 PM

Are you sure it isn't using the cordova.js from platforms/browser/www?

Comment 39 by om23 posted on 12/24/2014 at 8:11 PM

Hi I've been developing on Ubuntu 14.04. I was able to add the browser platform in my phonegap app however when I try 'cordova run browser' nothing happens. Chrome does not open up. I looked at /platforms/ browser/cordova/run script that 'cordova run browser' initiates and it seems to be build for Windows. I'm just wondering if someone has been using this functionality in an Linux development evironment and running into the same issue. The fix would be for the script to recognize that its in a Linux environment and execute Chrome that way. Correct me if I'm wrong and let me know if there's a fix.

Comment 40 (In reply to #39) by Raymond Camden posted on 12/25/2014 at 2:16 AM

I'd file a ticket w/ the CLI project that way you would know yourself when it is corrected. :)

Comment 41 by fatih posted on 12/27/2014 at 3:45 PM

Hi Raymond,

Thanks for the blog. Browser platform is really useful. I did not achieve to capture an image with browser. Could you please share your code?

Thanks.

Comment 42 (In reply to #41) by Raymond Camden posted on 12/27/2014 at 3:47 PM

Sorry, what? Can you rephrase what you asked?

Comment 43 (In reply to #10) by Ryan Archer posted on 12/29/2014 at 12:11 PM

I have used Ripple emulator in the past too. It's great but like i said, it is still in the PAST. I think last time I looked it was supporting PhoneGap 2.0 or something. Has anyone had a chance to put Adobe Edge Inspect up to the task yet? I have tested it when building responsive website design against my iPhone and iPad.

I have not tested it on any new Cordova applications yet but I'd bet that it would definitely be handy for testing. Just not sure about the API working and all. Can anyone confirm this?

Comment 44 (In reply to #43) by Raymond Camden posted on 12/29/2014 at 2:48 PM

Edge Inspect lets you inspect running web pages, but will not work with PhoneGap/Cordova apps. You can use Remote Debugging (Android, iOS) instead.

Comment 45 (In reply to #44) by Ryan Archer posted on 12/30/2014 at 11:59 PM

Not too sure what Remote Debugging is. In the past I have just connected Android/iOS devices and ran them through code in Terminal with Node.JS. Are you referring to the Phonegap developer app? http://app.phonegap.com/. Sorry I have just been away from PhoneGap and Apache Cordova for a while...

Comment 46 (In reply to #45) by Raymond Camden posted on 12/31/2014 at 12:34 AM

Go to my About Me page (http://www.raymondcamden.co... and see my two articles on mobile debugging.

Comment 47 by Marko Raatikka posted on 1/23/2015 at 10:01 AM

FWIW, I'm finding Cordova Mocks Chrome Plugin a fairly useful extension for mocking plugins for the browser. Avoids going through some of the hoops of cordova run browser :)

Comment 48 by David Wesst posted on 1/29/2015 at 10:19 PM

Thanks for this post Raymond! Great stuff many months after the release. :)

Just a quick question: I've noticed that when I take a picture using the Camera plugin, the datauri that comes back and is set to an IMG element ends up not being the full picture that was displayed in the injected video element.

Any ideas on this? It looks like the same behaviour you received in the post (video element is bigger than the actual picture saved).

Comment 49 (In reply to #48) by Raymond Camden posted on 1/29/2015 at 10:51 PM

If I had to guess, I'd say the developers probably didn't care since the video was just meant to represent the camera temporarily - not actually be what is displayed after the picture is taken - if that makes sense.

Comment 50 (In reply to #49) by David Wesst posted on 1/30/2015 at 9:43 PM

It does make sense. I suppose it's meant to wire in the core functionality rather than a refined UX. You need to start somewhere.
Thanks for the reply!

Comment 51 by KuRi posted on 2/25/2015 at 3:52 PM

I am using:

navigator.camera.getPicture(uploadPhoto,errorPhoto,{sourceType:1,destinationType:0,quality:60});

But when clicking on the button than launches this method nothing happens, no error, no webcam prompt... any idea?

Thanks!

Comment 52 (In reply to #51) by Raymond Camden posted on 2/25/2015 at 3:55 PM

Do you see anything in the console?

Comment 53 by Movizen posted on 2/26/2015 at 11:57 AM

Very good post!
In the new platform "Browser", you can use the plugin for file transfer? File and File Transfer.

Thank you..

Comment 54 (In reply to #53) by Raymond Camden posted on 2/26/2015 at 3:11 PM

I haven't checked in a while. Go to the git repo for those plugins and check - then let us know. :)

Comment 55 by Armel Kembe posted on 6/17/2015 at 11:44 PM

Is there any plan to have the browser as a supported platforn by Cordova in the near future? I am asking because I would like to have a subset on my Cordova application to run in the browser and I was wondering If I should wait for Cordova to do more progress on the Browser platform support or I should just go a head an create my own version of the cordova.js for the browser...

Comment 56 (In reply to #55) by Raymond Camden posted on 6/21/2015 at 12:45 PM

The best thing I can suggest for checking on "support for x" is to sign up for the developer list and ask there - that's where all plans/etc are discussed: http://cordova.apache.org/#...

Comment 57 (In reply to #56) by Armel Kembe posted on 6/22/2015 at 1:55 PM

Thanks Raymond. I will go there :)

Comment 58 by Piyush Muthal posted on 10/20/2015 at 9:17 AM

Hi , I am using barcode scanner plugin for browser platform . The scanner is not opening it is just prompting me for the barcode number and nothing else. Please tell me how barcode scanner can open in browser platform ?

Comment 59 (In reply to #58) by Raymond Camden posted on 10/20/2015 at 10:37 AM

You can't do a barcode scan on desktop. The prompt you are seeing is how the browser platform handles it.

Comment 60 (In reply to #59) by Piyush Muthal posted on 10/20/2015 at 11:30 AM

Thank you Raymond for your quick response . :)

Comment 61 (In reply to #59) by Piyush Muthal posted on 10/20/2015 at 11:43 AM

Raymond can you please suggest me any other alternative to run barcode scanner in web application ?

Comment 62 (In reply to #61) by Raymond Camden posted on 10/20/2015 at 12:59 PM

Not really. Some barcode scanners will automatically fill in a selected form field. You can try that.

Comment 63 by Rob Caldecott posted on 10/23/2015 at 9:00 AM

I cannot get a file picker to appear at all, in either Chrome or Firefox. The following code does nothing at all. If I change the sourceType to CAMERA then I can access my web cam OK. Any ideas?

navigator.camera.getPicture(
function(data) {
console.log(data);
},
function(message) {
console.log(message);
}, {
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.SAVEDPHOTOALBUM
}
);

Comment 64 (In reply to #63) by Raymond Camden posted on 10/23/2015 at 12:24 PM

Does the same code work in Chrome?

Comment 65 (In reply to #64) by Rob Caldecott posted on 10/24/2015 at 1:10 PM

It doesn't work on any desktop browser I've tried (Windows). Each time you call getPicture a new file input as added to the DOM but nothing else happens. I guess it should simulate a click on the input but it seems to be broken. I've opened an issue on the official tracker.

Comment 66 (In reply to #65) by Raymond Camden posted on 10/24/2015 at 4:40 PM

Oh, I think you are wrong. I believe the idea of the file input is to let you select an image and then it is added. In that way, it kind of acts like the device mechanism of selecting an image from the gallery.

Remember, the idea here isn't to 100% mimic what you get on device, but to let you test functionality.

Comment 67 (In reply to #66) by Rob Caldecott posted on 10/29/2015 at 12:15 PM

OK. Not particularly elegant, but fair enough. Your article is really all people have to go on regarding the browser platform, and it's not at all clear from the official site where it fits. I was hoping we might see it become something more than a test bed...

Comment 68 (In reply to #67) by Raymond Camden posted on 10/29/2015 at 2:02 PM

Speaking for myself, and NOT for the Cordova team, I still stand by my original assertion that this is only appropriate for testing, and *not* for having a web based version of a Cordova app. I don't believe the Cordova team (which technically I'm part of :) agrees with me there, but that's my opinion.

That doesn't make this feature any less useful of course. I still like it. :)

Comment 69 (In reply to #68) by Rob Caldecott posted on 10/29/2015 at 2:07 PM

I'm looking at building both web apps and hybrid mobile apps from the same source, so having the browser as a platform is a big deal. Even if it is not fully functional, it could make life a lot easier. Just being able to rely on little things like window.cordova.platformId being present can simplify my development. My next challenge is to try and find a way to get "cordova prepare browser" to run when any of my source files change. Any ideas? :)

Comment 70 (In reply to #69) by Raymond Camden posted on 10/29/2015 at 2:09 PM

Use gulp or grunt. Will take you five minutes. I've got a blog post showing an example of this. One sec.

This is old, but may help: http://www.raymondcamden.co...

Comment 71 (In reply to #70) by Rob Caldecott posted on 10/29/2015 at 2:16 PM

Ha! I knew it would be simple. This is excellent. You're a star.

Comment 72 by Ijem Ofili posted on 11/16/2015 at 8:08 PM

Hi all, thanks for helping out with questions as these. I have been trying to get Cordova to add the browser platform but keep getting this error-- https://uploads.disquscdn.c...

I'd mighty appreciate any help on this. Thanks in advance.

Comment 73 (In reply to #72) by Raymond Camden posted on 11/16/2015 at 8:29 PM

Is your CLI 100% up to date?
Can you add any other platform, like Android?

Comment 74 (In reply to #73) by Ijem Ofili posted on 11/16/2015 at 8:35 PM

My CLI is up to date, and I get the same message when I try to add Android as well.

Comment 75 (In reply to #74) by Raymond Camden posted on 11/16/2015 at 8:40 PM

I assumed you Googled, right? This help any? http://stackoverflow.com/qu...

Comment 76 (In reply to #75) by Ijem Ofili posted on 11/16/2015 at 8:46 PM

*smiles. I did google but could not find my specific case as per the screengrab. I'll use the SO link you provided and post back when the issue goes away. Thanks again.

UPDATE: I'm simply trying to add the browser platform on my main work laptop, most of the guides point to adding android. I tried the process on a virgin windows laptop and it worked just fine. So I'm thinking maybe my node file structure got 'baggage' needs sorting.

Comment 77 by Ronak kosamia posted on 1/4/2016 at 1:50 AM

Can i Have a your code of this example ??

Comment 78 (In reply to #77) by Raymond Camden posted on 1/4/2016 at 11:12 AM

All the code did was test the various APIs. It is nothing special.

Comment 79 by Robert Owen posted on 4/12/2016 at 3:17 AM

Hi Raymond, was there a solution or workaround to the microphone being included in the camera access? Seems like chrome ties mic and camera together for the access. Couldn't find your bug report.

Comment 80 (In reply to #79) by Raymond Camden posted on 4/12/2016 at 11:19 AM

Sorry, no, I don't think I filed a bug report for it. Since (imo) this is mainly for testing, it seems harmless. But I'd encourage you to file a bug report for it. :) (Yes, I'm being lazy.)

Comment 81 by Farzad YZ posted on 4/18/2016 at 5:29 AM

This was a relief! I'm using Cordova 5.4 and still did not know there is a platform named browser. Thanks for the Info.

Comment 82 by Ravi posted on 9/30/2016 at 7:16 PM

I want to use barcode scanner plugin for browser(mobile browser) platform , will it possible.?

Comment 83 (In reply to #82) by Raymond Camden posted on 9/30/2016 at 7:19 PM

If I remember right, on the browser, the barcode scanner just prompts you to enter the number. So technically, it works, but it isn't what you want probably.