carlo icon indicating copy to clipboard operation
carlo copied to clipboard

Specify minimum Chrome version / expose version info

Open rektide opened this issue 7 years ago • 2 comments

If I'm developing, say, an interesting WebRTC app, I may need some guarantees about what minimum version of the browser I can accept. It would be nice to have some API that lets me specify a minimum, before we try to launch, and which fails if that's not provided.

Alternatively, we could follow something like Node.js's process.versions object that exposes the version, such that users can readily get this information & do with it as they want.

These APIs would go a long way towards taking care of a series of complaints on Twitter that go something like:

Feature fragmentation for desktop apps? Hell no.

https://mobile.twitter.com/roman01la/status/1058029771693678593

This could also be an answer to #17.

rektide avatar Nov 01 '18 20:11 rektide

I think exposing the version is not going to help very much.

It's better to do feature detection.

if (navigator.getUserMedia) {
  // do stuff
} else {
  alert('Your version of Google Chrome does not support getUserMedia. Please upgrade.');
}

Occasionally features get added and then removed and then added again, for example SharedArrayBuffer.

Or maybe I misunderstood the proposal 😅

styfle avatar Nov 01 '18 21:11 styfle

I agree to @styfle but if you really need a version you could use something like this

https://stackoverflow.com/questions/4900436/how-to-detect-the-installed-chrome-version

function getChromeVersion () {     
    var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);

    return raw ? parseInt(raw[2], 10) : false;
}

If you need it in the node js part you could send it over via rpc

flexzuu avatar Nov 01 '18 21:11 flexzuu