I've created a large single page app using vue.js. Now I would like to detect browsers which are incompatible with vue.js and display a helpful error message to the user. I could grab one of many existing browser detection tools and make good guesses about which browsers should work but I would rather use feature detection as that is the recommend way to go.
Do you have any recommendations on how to detect which browsers should be able to run vue.js? Would it be sufficient to just check for Object.prototype.__defineSetter__?
Or perhaps Object.defineProperty would make more sense.
Yes, I think checking the presence of Object.defineProperty should be sufficient.
Thanks!
sorry ,my English is poor,

我用的是vue-cil ,lenova phone 渲染空白,
自带的低端浏览器,用其他的浏览器没问题,
我用了这个方法
var featureDetect = function () {
var vueTest = ('__defineSetter__' in Object.prototype);
var svgTest = !!document.createElementNS && !!document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect;
var transitionTest = ('transition' in document.documentElement.style) || ('WebkitTransition' in document.documentElement.style);
alert(vueTest + '//' + svgTest + '//' + transitionTest);
return vueTest && svgTest && transitionTest;
}
return is true,
How should I detect incompatible browsers
Personally, after much testing, for Vue the minimum you need is the following:
var compatibleBrowser = typeof Object['__defineSetter__'] === 'function';
@pixelbacon this will return 'false' for ie10 where vue is working fine.
Most helpful comment
Personally, after much testing, for Vue the minimum you need is the following: