alloy: Disable DocumentPictureInPictureAPI feature (see #3448)

This feature is default-enabled in M116+ but is not supported by the
Alloy runtime.
This commit is contained in:
Marshall Greenblatt 2023-09-19 14:24:56 -04:00
parent 57d7d89b53
commit 4df2933516
1 changed files with 10 additions and 0 deletions

View File

@ -43,6 +43,7 @@
#include "net/base/features.h" #include "net/base/features.h"
#include "sandbox/policy/switches.h" #include "sandbox/policy/switches.h"
#include "services/network/public/cpp/features.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 "third_party/blink/public/common/switches.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_features.h" #include "ui/base/ui_base_features.h"
@ -301,6 +302,15 @@ absl::optional<int> AlloyMainDelegate::BasicStartupComplete() {
disable_features.push_back(features::kBackForwardCache.name); 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()) { if (!disable_features.empty()) {
DCHECK(!base::FeatureList::GetInstance()); DCHECK(!base::FeatureList::GetInstance());
std::string disable_features_str = std::string disable_features_str =