discourse/app/assets/javascripts/browser-detect.js
Dan Ungureanu c85018cdfd
Improve support for old browsers (#9515)
* FEATURE: Improve crawler view

* FIX: Make lazyYT crawler-friendly

* DEV: Rename discourse-internet-explorer to discourse-unsupported-browser

* DEV: Detect more unsupported browsers

Follow-up to 4eebbd2212.

* FIX: Hide browser update notice in print view
2020-04-29 21:40:21 +03:00

13 lines
371 B
JavaScript

if (!window.WeakMap || !window.Promise) {
window.unsupportedBrowser = true;
} else {
// Some implementations of `WeakMap.prototype.has` do not accept false
// values and Ember's `isClassicDecorator` sometimes does that (it only
// checks for `null` and `undefined`).
try {
new WeakMap().has(0);
} catch (err) {
window.unsupportedBrowser = true;
}
}