diff --git a/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator_user_agent.https.html b/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator_user_agent.https.html index 0fb9e372b0dd6f..9409dd08e4d0e7 100644 --- a/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator_user_agent.https.html +++ b/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator_user_agent.https.html @@ -1,10 +1,11 @@ - + +
+ diff --git a/workers/WorkerNavigator_userAgentData.https.html b/workers/WorkerNavigator_userAgentData.https.html new file mode 100644 index 00000000000000..002c2f09710e33 --- /dev/null +++ b/workers/WorkerNavigator_userAgentData.https.html @@ -0,0 +1,30 @@ + + WorkerNavigator.userAgentData + + +
+ diff --git a/workers/support/WorkerNavigator.js b/workers/support/WorkerNavigator.js index 084e45b24585b9..1daeb2b35d5779 100644 --- a/workers/support/WorkerNavigator.js +++ b/workers/support/WorkerNavigator.js @@ -1,8 +1,20 @@ -var obj = new Object(); -obj.appName = navigator.appName; -obj.appVersion = navigator.appVersion; -obj.platform = navigator.platform; -obj.userAgent = navigator.userAgent; -obj.onLine = navigator.onLine; - -postMessage(obj); +(async () => { + var obj = new Object(); + obj.appName = navigator.appName; + obj.appVersion = navigator.appVersion; + obj.platform = navigator.platform; + obj.userAgent = navigator.userAgent; + obj.onLine = navigator.onLine; + if (navigator.userAgentData) { + obj.uaList = navigator.userAgentData.uaList; + obj.mobile = navigator.userAgentData.mobile; + const highEntropyValues = await navigator.userAgentData.getHighEntropyValues(["platform", "platformVersion", "architecture", "model", "uaFullVersion"]); + obj.platform = highEntropyValues.platform; + obj.platformVersion = highEntropyValues.platformVersion; + obj.architecture = highEntropyValues.architecture; + obj.model = highEntropyValues.model; + obj.uaFullVersion = highEntropyValues.uaFullVersion; + obj.NavigatorUADataExposed = (typeof self.NavigatorUAData != "undefined"); + } + postMessage(obj); +})();