Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow UA emulation when overriding #462

Merged
merged 2 commits into from
Feb 22, 2022

Conversation

vigneshshanmugam
Copy link
Member

  • When users are overriding the useragent with --playwright-options the UA was being overwritten in the agent code. This PR fixes that by using the UA passed to the agent.

src/core/gatherer.ts Outdated Show resolved Hide resolved
const syntheticsIdentifier = ' Elastic/Synthetics';
if (!userAgent) {
const session = await Gatherer.browser.newBrowserCDPSession();
({ userAgent } = await session.send('Browser.getVersion'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL

@apmmachine
Copy link
Collaborator

apmmachine commented Feb 22, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-02-22T21:43:31.366+0000

  • Duration: 17 min 27 sec

Test stats 🧪

Test Results
Failed 0
Passed 147
Skipped 3
Total 150

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Co-authored-by: Dominique Clarke <doclarke71@gmail.com>
Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I can see the correct user agent when using playwright options, appended with Elastic Synthetics.

Screen Shot 2022-02-22 at 4 56 18 PM

@vigneshshanmugam vigneshshanmugam merged commit c1ab52f into elastic:main Feb 22, 2022
@vigneshshanmugam vigneshshanmugam deleted the passthrough-ua branch February 22, 2022 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants