feat: allow setting of global fallback user agent (#18016)
* feat: allow setting of global fallback user agent * spec: add tests for app.set/getUserAgentFallback
This commit is contained in:
parent
649d7c0d9e
commit
d4f5ebefe6
9 changed files with 63 additions and 5 deletions
|
@ -64,6 +64,9 @@ class AtomBrowserClient : public content::ContentBrowserClient,
|
|||
// content::ContentBrowserClient:
|
||||
bool ShouldEnableStrictSiteIsolation() override;
|
||||
|
||||
std::string GetUserAgent() const override;
|
||||
void SetUserAgent(const std::string& user_agent);
|
||||
|
||||
protected:
|
||||
void RenderProcessWillLaunch(
|
||||
content::RenderProcessHost* host,
|
||||
|
@ -157,7 +160,6 @@ class AtomBrowserClient : public content::ContentBrowserClient,
|
|||
std::vector<base::FilePath> GetNetworkContextsParentDirectory() override;
|
||||
bool ShouldBypassCORB(int render_process_id) const override;
|
||||
std::string GetProduct() const override;
|
||||
std::string GetUserAgent() const override;
|
||||
void RegisterNonNetworkNavigationURLLoaderFactories(
|
||||
int frame_tree_node_id,
|
||||
NonNetworkURLLoaderFactoryMap* factories) override;
|
||||
|
@ -236,6 +238,8 @@ class AtomBrowserClient : public content::ContentBrowserClient,
|
|||
mutable base::Lock process_preferences_lock_;
|
||||
std::map<int, ProcessPreferences> process_preferences_;
|
||||
|
||||
std::string user_agent_override_ = "";
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomBrowserClient);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue