MCPcopy Index your code
hub / github.com/ampproject/amphtml / getUserAgentClientHintParameters

Function getUserAgentClientHintParameters

ads/google/a4a/utils.js:1036–1053  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

1034 * @return {!Promise<!UADataValues|undefined>}
1035 */
1036function 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}

Callers 1

googlePageParametersFunction · 0.85

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected