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

2 participants
@MarshallOfSound
Copy link
Member

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

@MarshallOfSound

This comment has been minimized.

Copy link
Member Author

commented Apr 28, 2019

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

@codebytere
Copy link
Member

left a comment

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 Apr 30, 2019

@codebytere

This comment has been minimized.

Copy link
Member

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

@MarshallOfSound MarshallOfSound force-pushed the feat/set-user-agent-globally branch from e50aa19 to 05fea02 Apr 30, 2019

@codebytere
Copy link
Member

left a comment

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

@MarshallOfSound MarshallOfSound merged commit d4f5ebe into master May 1, 2019

12 of 16 checks passed

appveyor: win-ia32-testing AppVeyor build failed
Details
Artifact Comparison Changes Detected
Details
Backportable? - 6-0-x Backport Failed
Details
Check release notes Check release notes
Details
Check release notes Check release notes
Details
Semantic Pull Request ready to be merged or rebased
Details
WIP Ready for review
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
build-linux Workflow: build-linux
Details
build-mac Workflow: build-mac
Details
electron-arm-testing Build #20190430.37 succeeded
Details
electron-arm64-testing Build #20190430.38 succeeded
Details
lint Workflow: lint
Details
release-notes Release notes found

@MarshallOfSound MarshallOfSound deleted the feat/set-user-agent-globally branch May 1, 2019

@release-clerk

This comment has been minimized.

Copy link

commented May 1, 2019

Release Notes Persisted

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

@trop

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

commented May 2, 2019

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

1 similar comment
@trop

This comment has been minimized.

Copy link
Contributor

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-git added a commit to Kiku-git/electron that referenced this pull request May 16, 2019

feat: allow setting of global fallback user agent (electron#18016)
* feat: allow setting of global fallback user agent

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

This comment has been minimized.

Copy link
Contributor

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.0.x May 29, 2019

@sofianguy sofianguy moved this from Fixed for Next Release to Fixed for 6.0.0-beta.5 in 6.0.x May 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.