Skip to content

feat: allow setting of global fallback user agent - #18016

Merged
MarshallOfSound merged 2 commits into
masterfrom
feat/set-user-agent-globally
May 1, 2019
Merged

MarshallOfSound merged 2 commits into
masterfrom
feat/set-user-agent-globally

Conversation

@MarshallOfSound

@MarshallOfSound MarshallOfSound commented Apr 28, 2019 •

Copy link
Copy Markdown
Member

Currently we support letting apps set user agents on webContents and session but not "for everything". Well this PR allows you to do just that. In particular it allows apps to do a few things

  • Set the user agent in one place for everything regardless of sessions / webContents used
  • Set the user agent for parts of Chromium that we previously couldn't override due to incomplete wiring inside Chromium. E.g. Tracing controllers, accessibility, service workers, etc.

Notes: Added new app.userAgentFallback property to allow setting the apps useragent globally

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Apr 28, 2019
@MarshallOfSound

Copy link
Copy Markdown
Member Author

Put this on the @electron/wg-releases agenda to discuss target/6-0-x

@codebytere codebytere left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It'd be awesome if this was set as a property on the prototype instead :)

@MarshallOfSound
MarshallOfSound force-pushed the feat/set-user-agent-globally branch from 0a13c3c to e50aa19 Compare April 30, 2019 19:37
@codebytere

codebytere commented Apr 30, 2019 •

Copy link
Copy Markdown
Member

--- a/atom/browser/api/atom_api_app.cc
+++ b/atom/browser/api/atom_api_app.cc
@@ -1456,7 +1456,8 @@
 #if defined(OS_MACOSX)
       .SetProperty("dock", &App::GetDockAPI)
 #endif
-      .SetProperty("userAgentFallback", &App::GetUserAgentFallback, &App::SetUserAgentFallback)
+      .SetProperty("userAgentFallback", &App::GetUserAgentFallback,
+                   &App::SetUserAgentFallback)
       .SetMethod("enableSandbox", &App::EnableSandbox);
 }

lint death ☝️

@MarshallOfSound
MarshallOfSound force-pushed the feat/set-user-agent-globally branch from e50aa19 to 05fea02 Compare April 30, 2019 19:56

@codebytere codebytere left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm but i'd love a second review before we merge this.

@codebytere codebytere added the semver/minor backwards-compatible functionality label May 1, 2019
@MarshallOfSound
MarshallOfSound merged commit d4f5ebe into master May 1, 2019
@MarshallOfSound
MarshallOfSound deleted the feat/set-user-agent-globally branch May 1, 2019 23:34
@release-clerk

release-clerk Bot commented May 1, 2019 •

Copy link
Copy Markdown

Release Notes Persisted

Added new app.userAgentFallback property to allow setting the apps useragent globally

@trop

trop Bot commented May 1, 2019

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "6-0-x" cleanly;
you will need to perform this backport manually.

@trop

trop Bot commented May 2, 2019

Copy link
Copy Markdown
Contributor

A maintainer has manually backported this PR to "4-2-x", please check out #18110

1 similar comment
@trop

trop Bot commented May 2, 2019

Copy link
Copy Markdown
Contributor

A maintainer has manually backported this PR to "4-2-x", please check out #18110

@trop

trop Bot commented May 28, 2019

Copy link
Copy Markdown
Contributor

A maintainer has manually backported this PR to "6-0-x", please check out #18473

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants