()
| 1049 | } |
| 1050 | |
| 1051 | function isHoverPreviewDisabled() { |
| 1052 | if (window.disableHoverPreview === true) return true; |
| 1053 | |
| 1054 | // Keep disabled on touch-only/coarse-only devices, but allow hybrid devices |
| 1055 | // (for example iPad + trackpad/mouse) that expose any hover-capable pointer. |
| 1056 | try { |
| 1057 | if (window.matchMedia) { |
| 1058 | const hasHoverPointer = |
| 1059 | window.matchMedia('(any-hover: hover)').matches || |
| 1060 | window.matchMedia('(hover: hover)').matches || |
| 1061 | window.matchMedia('(any-pointer: fine)').matches || |
| 1062 | window.matchMedia('(pointer: fine)').matches; |
| 1063 | const touchOnlyLikely = |
| 1064 | ( |
| 1065 | window.matchMedia('(pointer: coarse)').matches || |
| 1066 | window.matchMedia('(any-pointer: coarse)').matches || |
| 1067 | window.matchMedia('(hover: none)').matches || |
| 1068 | window.matchMedia('(any-hover: none)').matches |
| 1069 | ) && |
| 1070 | !hasHoverPointer; |
| 1071 | if (touchOnlyLikely) return true; |
| 1072 | } |
| 1073 | } catch (e) {} |
| 1074 | |
| 1075 | try { |
| 1076 | return localStorage.getItem("disableHoverPreview") === "true"; |
| 1077 | } catch (e) { |
| 1078 | return false; |
| 1079 | } |
| 1080 | } |
| 1081 | |
| 1082 | function normalizeHoverPreviewDelayMs(value) { |
| 1083 | const parsed = parseInt(value, 10); |
no outgoing calls
no test coverage detected