canarytrace / documentation

Plug’n'Play stack for testing and monitoring web applications from user perspective.
http://canarytrace.com
5 stars 0 forks source link

userAgentData doesn't function as expected if the web page isn't in a secure context. #198

Closed rdpanek closed 11 months ago

rdpanek commented 11 months ago

In the event that the page is controlled by the DevTools protocol (webdriver), userAgentData exists but lacks information. For example, when running Playwright after a clean installation using npx playwright test, you may encounter the following error:

Uncaught TypeError: Cannot read properties of undefined (reading 'brand')
    at collector (rum:1:16120)
    at rum:1:20575
    at sentryWrapped (helpers.ts:77:19)

As for the behavior of the navigator.userAgentData API, it returns:

{
    "brands": [],
    "mobile": false,
    "platform": ""
}
rdpanek commented 11 months ago

Canarytrace RUM now logs attributes.browser: "automated" if the web page is controlled by an automation framework.