* This method retrieves the high-entropy portions of the user agent * information. * See https://wicg.github.io/ua-client-hints/#getHighEntropyValues * @param {!Window} win * @return {!Promise<!UADataValues|undefined>}
(win)
| 1034 | * @return {!Promise<!UADataValues|undefined>} |
| 1035 | */ |
| 1036 | function getUserAgentClientHintParameters(win) { |
| 1037 | if ( |
| 1038 | !win.navigator || |
| 1039 | !win.navigator.userAgentData || |
| 1040 | typeof win.navigator.userAgentData.getHighEntropyValues !== 'function' |
| 1041 | ) { |
| 1042 | return Promise.resolve(); |
| 1043 | } |
| 1044 | |
| 1045 | return win.navigator.userAgentData.getHighEntropyValues([ |
| 1046 | 'platform', |
| 1047 | 'platformVersion', |
| 1048 | 'architecture', |
| 1049 | 'model', |
| 1050 | 'uaFullVersion', |
| 1051 | 'bitness', |
| 1052 | ]); |
| 1053 | } |
no test coverage detected