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

feat: allow setting of global fallback user agent #18016

Merged
merged 2 commits into from May 1, 2019

Conversation

MarshallOfSound
Copy link
Member

@MarshallOfSound MarshallOfSound commented Apr 28, 2019

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 in the last 24 hours label Apr 28, 2019
@MarshallOfSound
Copy link
Member Author

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

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Apr 29, 2019
Copy link
Member

@codebytere codebytere left a comment

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

@codebytere
Copy link
Member

codebytere commented Apr 30, 2019


--- 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 ☝️

Copy link
Member

@codebytere codebytere left a comment

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
Copy link

release-clerk bot commented May 1, 2019

Release Notes Persisted

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

@trop
Copy link
Contributor

trop bot commented May 1, 2019

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

@trop
Copy link
Contributor

trop bot commented May 2, 2019

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

1 similar comment
@trop
Copy link
Contributor

trop bot commented May 2, 2019

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

@trop trop bot added the in-flight/4-2-x label May 2, 2019
kiku-jw pushed a commit to kiku-jw/electron that referenced this pull request May 16, 2019
* feat: allow setting of global fallback user agent

* spec: add tests for app.set/getUserAgentFallback
@trop
Copy link
Contributor

trop bot commented May 28, 2019

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

@sofianguy sofianguy added this to Fixed for Next Release in 6.1.x May 29, 2019
@sofianguy sofianguy moved this from Fixed for Next Release to Fixed for 6.0.0-beta.5 in 6.1.x May 29, 2019
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
No open projects
6.1.x
Fixed for 6.0.0-beta.5
Development

Successfully merging this pull request may close these issues.

None yet

2 participants