UNPKG

1.18 kBJavaScriptView Raw
1var _vendorSettings;
2export function getVendorSettings() {
3 if (!_vendorSettings) {
4 var doc = typeof document !== 'undefined' ? document : undefined;
5 var nav = typeof navigator !== 'undefined' ? navigator : undefined;
6 var userAgent = nav ? nav.userAgent.toLowerCase() : undefined;
7 if (!doc) {
8 _vendorSettings = {
9 isWebkit: true,
10 isMoz: true,
11 isOpera: true,
12 isMs: true,
13 };
14 }
15 else {
16 _vendorSettings = {
17 isWebkit: !!(doc && 'WebkitAppearance' in doc.documentElement.style),
18 isMoz: !!(userAgent && userAgent.indexOf('firefox') > -1),
19 isOpera: !!(userAgent && userAgent.indexOf('opera') > -1),
20 isMs: !!(nav && (/rv:11.0/i.test(nav.userAgent) || /Edge\/\d./i.test(navigator.userAgent))),
21 };
22 }
23 }
24 return _vendorSettings;
25}
26/**
27 * Sets the vendor settings for prefixing and vendor specific operations.
28 */
29export function setVendorSettings(vendorSettings) {
30 _vendorSettings = vendorSettings;
31}
32//# sourceMappingURL=getVendorSettings.js.map
\No newline at end of file