()
| 51 | * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk. |
| 52 | */ |
| 53 | export function isChromium(): boolean { |
| 54 | // Based on research in October 2020. Tested to detect Chromium 42-86. |
| 55 | const w = window |
| 56 | const n = navigator |
| 57 | |
| 58 | return ( |
| 59 | countTruthy([ |
| 60 | 'webkitPersistentStorage' in n, |
| 61 | 'webkitTemporaryStorage' in n, |
| 62 | (n.vendor || '').indexOf('Google') === 0, |
| 63 | 'webkitResolveLocalFileSystemURL' in w, |
| 64 | 'BatteryManager' in w, |
| 65 | 'webkitMediaStream' in w, |
| 66 | 'webkitSpeechGrammar' in w, |
| 67 | ]) >= 5 |
| 68 | ) |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Checks whether the browser is based on mobile or desktop Safari without using user-agent. |
no test coverage detected
searching dependent graphs…