|
@@ -20,9 +20,19 @@ export class PluginConfigItem<T = any> {
|
|
|
function item<T>(key: string, defaultValue?: T) { return new PluginConfigItem(key, defaultValue); }
|
|
|
|
|
|
|
|
|
-
|
|
|
-function is_iOS() {
|
|
|
+function preferWebGl1() {
|
|
|
if (typeof navigator === 'undefined' || typeof window === 'undefined') return false;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (navigator.userAgent.indexOf('Version/15.1 Safari') > 0) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
|
|
|
const isAppleDevice = navigator.userAgent.includes('Macintosh');
|
|
|
const isTouchScreen = navigator.maxTouchPoints >= 4;
|
|
@@ -41,7 +51,7 @@ export const PluginConfig = {
|
|
|
EnableWboit: item('plugin-config.enable-wboit', true),
|
|
|
|
|
|
|
|
|
- PreferWebGl1: item('plugin-config.prefer-webgl1', is_iOS()),
|
|
|
+ PreferWebGl1: item('plugin-config.prefer-webgl1', preferWebGl1()),
|
|
|
},
|
|
|
State: {
|
|
|
DefaultServer: item('plugin-state.server', 'https://webchem.ncbr.muni.cz/molstar-state'),
|