google / google-visualization-issues

288 stars 35 forks source link

Your browser doesn't support charts. Why use useragent checking in stead of feature detection? #2209

Open matthiaz opened 8 years ago

matthiaz commented 8 years ago

I've noticed that google-visualization checks the useragent to figure out if the webbrowser supports google charts. I have no idea what the actual check is, since this is not an open source project. But I do believe checking the browser agent is a bad idea. The user can change the useragent using a simple extension https://chrome.google.com/webstore/detail/user-agent-switcher-for-g/ffhkkpnppgnfaobgihpdblnhmmbodake

The same thing applies to firefox and internet explorer.

Can this be changed to do feature detection in stead of user agent checking?

dlaliberte commented 8 years ago

We would prefer to do feature detection, if it can be done reliably. We use the feature detection that is embedded within Google Closure, but there are still some things that are only caught with browser detection. Are you having a particular problem that we should address?

matthiaz commented 8 years ago

At our company we developed a hybrid application in QT. The application gets most of it's data from the web using QT Webkit and some data using local c++ functions.

If we use google visualisation charts in the webbrowser part, it keeps telling us "browser does not support charts". When we change the user-agent to the same as google chrome, we don't get this message so QT webkit is perfectly able to display the charts. But this of course is not ideal. The QT Webkit application now looks like google chrome, but that isn't really true.

You can simulate the same behaviour in google chrome by simply changing the user-agent that google chrome sends (see link to an extension that does just that).

dlaliberte commented 8 years ago

We do have a check for the browser type and version number before any thing else is done in drawing a chart. We should be checking for svg or vml instead. I hope your workaround that specifies the user-agent will be good enough until this can be fixed.

matthiaz commented 8 years ago

I made a work around for it but it is far from ideal. So yeah if this could be fixed, I would be very happy :-)

mfairchild365 commented 7 years ago

Can confirm that this is still an issue.

horus68 commented 5 years ago

confirmed an an issue in Microsoft Edge windows 10