custom user agent
This commit is contained in:
+7
@@ -103,6 +103,9 @@ class GeckoEngineSettingsApiImpl : GeckoEngineSettingsApi {
|
||||
WebContentIsolationStrategy.ISOLATE_HIGH_VALUE -> mozilla.components.concept.engine.fission.WebContentIsolationStrategy.ISOLATE_HIGH_VALUE
|
||||
}
|
||||
}
|
||||
if(settings.userAgent != null) {
|
||||
components.core.engineSettings.userAgentString = settings.userAgent;
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateRuntimeSettings(settings: GeckoEngineSettings) {
|
||||
@@ -149,6 +152,10 @@ class GeckoEngineSettingsApiImpl : GeckoEngineSettingsApi {
|
||||
if(settings.webContentIsolationStrategy != null) {
|
||||
components.core.engine.settings.webContentIsolationStrategy = components.core.engineSettings.webContentIsolationStrategy
|
||||
}
|
||||
if(settings.userAgent != null) {
|
||||
components.core.engine.settings.userAgentString = components.core.engineSettings.userAgentString
|
||||
reloadSession = true
|
||||
}
|
||||
|
||||
if(reloadSession) {
|
||||
components.useCases.sessionUseCases.reload()
|
||||
|
||||
+5
-2
@@ -1451,7 +1451,8 @@ data class GeckoEngineSettings (
|
||||
val cookieBannerHandlingModePrivateBrowsing: CookieBannerHandlingMode? = null,
|
||||
val cookieBannerHandlingGlobalRules: Boolean? = null,
|
||||
val cookieBannerHandlingGlobalRulesSubFrames: Boolean? = null,
|
||||
val webContentIsolationStrategy: WebContentIsolationStrategy? = null
|
||||
val webContentIsolationStrategy: WebContentIsolationStrategy? = null,
|
||||
val userAgent: String? = null
|
||||
)
|
||||
{
|
||||
companion object {
|
||||
@@ -1466,7 +1467,8 @@ data class GeckoEngineSettings (
|
||||
val cookieBannerHandlingGlobalRules = pigeonVar_list[7] as Boolean?
|
||||
val cookieBannerHandlingGlobalRulesSubFrames = pigeonVar_list[8] as Boolean?
|
||||
val webContentIsolationStrategy = pigeonVar_list[9] as WebContentIsolationStrategy?
|
||||
return GeckoEngineSettings(javascriptEnabled, trackingProtectionPolicy, httpsOnlyMode, globalPrivacyControlEnabled, preferredColorScheme, cookieBannerHandlingMode, cookieBannerHandlingModePrivateBrowsing, cookieBannerHandlingGlobalRules, cookieBannerHandlingGlobalRulesSubFrames, webContentIsolationStrategy)
|
||||
val userAgent = pigeonVar_list[10] as String?
|
||||
return GeckoEngineSettings(javascriptEnabled, trackingProtectionPolicy, httpsOnlyMode, globalPrivacyControlEnabled, preferredColorScheme, cookieBannerHandlingMode, cookieBannerHandlingModePrivateBrowsing, cookieBannerHandlingGlobalRules, cookieBannerHandlingGlobalRulesSubFrames, webContentIsolationStrategy, userAgent)
|
||||
}
|
||||
}
|
||||
fun toList(): List<Any?> {
|
||||
@@ -1481,6 +1483,7 @@ data class GeckoEngineSettings (
|
||||
cookieBannerHandlingGlobalRules,
|
||||
cookieBannerHandlingGlobalRulesSubFrames,
|
||||
webContentIsolationStrategy,
|
||||
userAgent,
|
||||
)
|
||||
}
|
||||
override fun equals(other: Any?): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user