@@ -359,10 +359,10 @@ index 1eb7abb2fa21d7a8ec0833160f53e5c523ec4317..7709bcc2ec69aab0589ca1b954db1fb2
359
359
FrontendChannel::ConnectionType connectionType() const;
360
360
diff --git a/Source/JavaScriptCore/inspector/protocol/Browser.json b/Source/JavaScriptCore/inspector/protocol/Browser.json
361
361
new file mode 100644
362
- index 0000000000000000000000000000000000000000..b9ac6ebfb1ba16f83663f3fbe29e619ba2befe13
362
+ index 0000000000000000000000000000000000000000..efd406f0a6b7aa0e1e484665cbe863f1233524dd
363
363
--- /dev/null
364
364
+++ b/Source/JavaScriptCore/inspector/protocol/Browser.json
365
- @@ -0,0 +1,202 @@
365
+ @@ -0,0 +1,210 @@
366
366
+{
367
367
+ "domain": "Browser",
368
368
+ "availability": ["web"],
@@ -539,6 +539,14 @@ index 0000000000000000000000000000000000000000..b9ac6ebfb1ba16f83663f3fbe29e619b
539
539
+ { "name": "browserContextId", "$ref": "ContextID", "optional": true, "description": "Browser context id." }
540
540
+ ],
541
541
+ "description": "Clears permission overrides."
542
+ + },
543
+ + {
544
+ + "name": "setLanguage",
545
+ + "description": "Allows to set locale language for context.",
546
+ + "parameters": [
547
+ + { "name": "language", "type": "string" },
548
+ + { "name": "browserContextId", "$ref": "ContextID", "optional": true, "description": "Browser context id." }
549
+ + ]
542
550
+ }
543
551
+ ],
544
552
+ "events": [
@@ -7371,10 +7379,10 @@ index 78caedf0c0ce83675569502d150fcc44e5f9868c..46b9901263286eab6de0bc4f899349d5
7371
7379
} // namespace WebKit
7372
7380
diff --git a/Source/WebKit/UIProcess/InspectorBrowserAgent.cpp b/Source/WebKit/UIProcess/InspectorBrowserAgent.cpp
7373
7381
new file mode 100644
7374
- index 0000000000000000000000000000000000000000..d8dbb6391594955a23a5ed3cb34b05ca0b47acc1
7382
+ index 0000000000000000000000000000000000000000..3a945691c06155bdcfe8d6928447c3dcb047f686
7375
7383
--- /dev/null
7376
7384
+++ b/Source/WebKit/UIProcess/InspectorBrowserAgent.cpp
7377
- @@ -0,0 +1,497 @@
7385
+ @@ -0,0 +1,505 @@
7378
7386
+/*
7379
7387
+ * Copyright (C) 2019 Microsoft Corporation.
7380
7388
+ *
@@ -7812,6 +7820,14 @@ index 0000000000000000000000000000000000000000..d8dbb6391594955a23a5ed3cb34b05ca
7812
7820
+ }
7813
7821
+}
7814
7822
+
7823
+ +void InspectorBrowserAgent::setLanguage(Inspector::ErrorString& errorString, const String& language, const String* browserContextID)
7824
+ +{
7825
+ + BrowserContext browserContext = lookupBrowserContext(errorString, browserContextID);
7826
+ + if (!errorString.isEmpty())
7827
+ + return;
7828
+ + browserContext.processPool->setLanguageForAutomation(language);
7829
+ +}
7830
+ +
7815
7831
+void InspectorBrowserAgent::setGeolocationOverride(Inspector::ErrorString& errorString, const String* browserContextID, const JSON::Object* geolocation)
7816
7832
+{
7817
7833
+ BrowserContext browserContext = lookupBrowserContext(errorString, browserContextID);
@@ -7874,10 +7890,10 @@ index 0000000000000000000000000000000000000000..d8dbb6391594955a23a5ed3cb34b05ca
7874
7890
+#endif // ENABLE(REMOTE_INSPECTOR)
7875
7891
diff --git a/Source/WebKit/UIProcess/InspectorBrowserAgent.h b/Source/WebKit/UIProcess/InspectorBrowserAgent.h
7876
7892
new file mode 100644
7877
- index 0000000000000000000000000000000000000000..8f224acabb5b2010368f25b9b6d5ca0a3b75cd0b
7893
+ index 0000000000000000000000000000000000000000..87951616c1ad9afbaf645a7ef164df4c93c53f27
7878
7894
--- /dev/null
7879
7895
+++ b/Source/WebKit/UIProcess/InspectorBrowserAgent.h
7880
- @@ -0,0 +1,113 @@
7896
+ @@ -0,0 +1,114 @@
7881
7897
+/*
7882
7898
+ * Copyright (C) 2019 Microsoft Corporation.
7883
7899
+ *
@@ -7970,6 +7986,7 @@ index 0000000000000000000000000000000000000000..8f224acabb5b2010368f25b9b6d5ca0a
7970
7986
+ void grantPermissions(Inspector::ErrorString&, const String* browserContextID, const String& origin, const JSON::Array& permissions) override;
7971
7987
+ void resetPermissions(Inspector::ErrorString&, const String* browserContextID) override;
7972
7988
+ void setGeolocationOverride(Inspector::ErrorString&, const String* browserContextID, const JSON::Object* geolocation) override;
7989
+ + void setLanguage(Inspector::ErrorString&, const String& language, const String* browserContextID) override;
7973
7990
+
7974
7991
+ static String toBrowserContextIDProtocolString(const PAL::SessionID&);
7975
7992
+ static String toPageProxyIDProtocolString(const WebPageProxy&);
@@ -9357,8 +9374,25 @@ index a6d4c6173b0fd75a5f507e44f60f7dfd14f433b4..d2721d8356841fd5b3b16c808c35522d
9357
9374
9358
9375
#if ENABLE(NETSCAPE_PLUGIN_API)
9359
9376
UnavailablePluginButtonClicked(uint32_t pluginUnavailabilityReason, String mimeType, String pluginURLString, String pluginspageAttributeURLString, String frameURLString, String pageURLString)
9377
+ diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp
9378
+ index e1ce3a17d5c6d38a12e54cc1f45f951c16b290d6..de49f636874949990ffba16fc8c8bc8e8b9e7efb 100644
9379
+ --- a/Source/WebKit/UIProcess/WebProcessPool.cpp
9380
+ +++ b/Source/WebKit/UIProcess/WebProcessPool.cpp
9381
+ @@ -987,7 +987,11 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa
9382
+ #endif
9383
+
9384
+ parameters.cacheModel = LegacyGlobalSettings::singleton().cacheModel();
9385
+ - parameters.languages = configuration().overrideLanguages().isEmpty() ? userPreferredLanguages() : configuration().overrideLanguages();
9386
+ + if (m_languageForAutomation.isNull()) {
9387
+ + parameters.languages = configuration().overrideLanguages().isEmpty() ? userPreferredLanguages() : configuration().overrideLanguages();
9388
+ + } else {
9389
+ + parameters.languages.append(m_languageForAutomation);
9390
+ + }
9391
+
9392
+ parameters.urlSchemesRegisteredAsEmptyDocument = copyToVector(m_schemesToRegisterAsEmptyDocument);
9393
+ parameters.urlSchemesRegisteredAsSecure = copyToVector(LegacyGlobalSettings::singleton().schemesToRegisterAsSecure());
9360
9394
diff --git a/Source/WebKit/UIProcess/WebProcessPool.h b/Source/WebKit/UIProcess/WebProcessPool.h
9361
- index 64b1dbce4c907536999b1c2a5eb314670f423e1e..e86d634f64fdaa0fd4a9338ffba566bf7209e02d 100644
9395
+ index 64b1dbce4c907536999b1c2a5eb314670f423e1e..b9297305dab1d5001ee184747d58bd8b4999ac84 100644
9362
9396
--- a/Source/WebKit/UIProcess/WebProcessPool.h
9363
9397
+++ b/Source/WebKit/UIProcess/WebProcessPool.h
9364
9398
@@ -416,7 +416,7 @@ public:
@@ -9370,7 +9404,24 @@ index 64b1dbce4c907536999b1c2a5eb314670f423e1e..e86d634f64fdaa0fd4a9338ffba566bf
9370
9404
void setIgnoreTLSErrors(bool);
9371
9405
bool ignoreTLSErrors() const { return m_ignoreTLSErrors; }
9372
9406
#endif
9373
- @@ -711,8 +711,8 @@ private:
9407
+ @@ -537,6 +537,8 @@ public:
9408
+
9409
+ PlugInAutoStartProvider& plugInAutoStartProvider() { return m_plugInAutoStartProvider; }
9410
+
9411
+ + void setLanguageForAutomation(const String& language) { m_languageForAutomation = language; }
9412
+ +
9413
+ void setUseSeparateServiceWorkerProcess(bool);
9414
+ bool useSeparateServiceWorkerProcess() const { return m_useSeparateServiceWorkerProcess; }
9415
+
9416
+ @@ -642,6 +644,7 @@ private:
9417
+ std::unique_ptr<API::CustomProtocolManagerClient> m_customProtocolManagerClient;
9418
+
9419
+ RefPtr<WebAutomationSession> m_automationSession;
9420
+ + String m_languageForAutomation;
9421
+
9422
+ #if ENABLE(NETSCAPE_PLUGIN_API)
9423
+ PluginInfoStore m_pluginInfoStore;
9424
+ @@ -711,8 +714,8 @@ private:
9374
9425
HashMap<uint64_t, RefPtr<DictionaryCallback>> m_dictionaryCallbacks;
9375
9426
HashMap<uint64_t, RefPtr<StatisticsRequest>> m_statisticsRequests;
9376
9427
0 commit comments