Compatibility service

When I write Javascript code for a web page to do things like let the user access their microphone or camera, I end up needing to put in a whole bunch of cases, because I don’t know which version of which browser on which computer is being used.

For example, it might be an old version of Chrome on Android, or last year’s version of Safari on IOS, or the latest version of Internet Explorer on a PC. In each case, there might be a different way to write the code, and my program needs to check for each case and then do the right thing.

But if I leave that program sitting on my web page for a year or two, it starts to break. Standards get upgraded, old software interfaces get retired, and new versions of each browser start to come out, which maybe support this feature but not yet that feature. The same carefully defensive code I wrote last year no longer works for everyone everywhere.

What I really want is a service run by some trusted agent — maybe Google. My web page tells my browser to fetch the latest set of tests from that service provider, and I use those updated tests whenever somebody surfs to my web page. Then it’s that service provider’s responsibility to keep such compatibility tests up to date for all of the web programs written by people like me.

But it has to be a trusted agent, for two reasons: (1) If the site belongs to a company that goes out of business, or some professor who leaves for another University, then the site disappears, and everybody is out of luck; (2) If the site belongs to an entity that is not scrupulously honest, then I might be enabling a “Trojan Horse” that will compromise the security of people who use my web page.

Google is an example of such a trusted agent. It’s not going away any time soon, and it is in the business (literally) of being an honest and impartial broker. If people stop trusting Google to be honest, then those people will stop using it, and its entire ad-based revenue model will fall apart. And its business model depends on being platform agnostic (unlike, say, Apple).

So why isn’t there already such a service? Or is there?