UNPKG

molstar

Version:

A comprehensive macromolecular library.

31 lines (30 loc) 1.18 kB
"use strict"; /** * Copyright (c) 2021-2024 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> * @author Alexander Rose <alexander.rose@weirdbyte.de> */ Object.defineProperty(exports, "__esModule", { value: true }); exports.PluginFeatureDetection = void 0; const browser_1 = require("../mol-util/browser"); exports.PluginFeatureDetection = { get defaultTransparency() { return (0, browser_1.is_iOS)() ? 'blended' : 'wboit'; }, get preferWebGl1() { if (typeof navigator === 'undefined' || typeof window === 'undefined') return false; // WebGL2 isn't working in MacOS 12.0.1 Safari 15.1, 15.2. It is working in Safari 15.4 tech preview, so disabling all versions before that. // prefer webgl 1 based on the userAgent substring const unpportedSafariVersions = [ 'Version/15.1 Safari', 'Version/15.2 Safari', 'Version/15.3 Safari', ]; if (unpportedSafariVersions.some(v => navigator.userAgent.indexOf(v) > 0)) { return true; } return (0, browser_1.is_iOS)(); }, };