From 4df2933516eb98a8a7cacfc02988efd1bd3a670c Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 19 Sep 2023 14:24:56 -0400 Subject: [PATCH] alloy: Disable DocumentPictureInPictureAPI feature (see #3448) This feature is default-enabled in M116+ but is not supported by the Alloy runtime. --- libcef/common/alloy/alloy_main_delegate.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libcef/common/alloy/alloy_main_delegate.cc b/libcef/common/alloy/alloy_main_delegate.cc index 9b25c2ac0..0c12ac8d5 100644 --- a/libcef/common/alloy/alloy_main_delegate.cc +++ b/libcef/common/alloy/alloy_main_delegate.cc @@ -43,6 +43,7 @@ #include "net/base/features.h" #include "sandbox/policy/switches.h" #include "services/network/public/cpp/features.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/switches.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_features.h" @@ -301,6 +302,15 @@ absl::optional AlloyMainDelegate::BasicStartupComplete() { disable_features.push_back(features::kBackForwardCache.name); } + if (blink::features::kDocumentPictureInPictureAPI.default_state == + base::FEATURE_ENABLED_BY_DEFAULT) { + // Disable DocumentPictureInPictureAPI globally so that + // blink::RuntimeEnabledFeatures::DocumentPictureInPictureAPIEnabled + // reports the correct value in the renderer process (see issue #3448). + disable_features.push_back( + blink::features::kDocumentPictureInPictureAPI.name); + } + if (!disable_features.empty()) { DCHECK(!base::FeatureList::GetInstance()); std::string disable_features_str =