From 41678f396299cc4e474f7dc93e327df7b7bdd684 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Sun, 7 May 2023 17:34:55 +0200 Subject: [PATCH] Disable GetInstalledRelatedApps API --- ...0Disable-GetInstalledRelatedApps-API.patch | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 build/patches/00Disable-GetInstalledRelatedApps-API.patch diff --git a/build/patches/00Disable-GetInstalledRelatedApps-API.patch b/build/patches/00Disable-GetInstalledRelatedApps-API.patch new file mode 100644 index 00000000..5a44505f --- /dev/null +++ b/build/patches/00Disable-GetInstalledRelatedApps-API.patch @@ -0,0 +1,67 @@ +From: uazo +Date: Sun, 7 May 2023 13:13:47 +0000 +Subject: Disable GetInstalledRelatedApps API + +--- + .../components/installedapp/InstalledAppProviderImpl.java | 1 + + .../browser/installedapp/installed_app_provider_impl_win.cc | 1 + + content/public/common/content_features.cc | 4 ++-- + .../blink/renderer/platform/runtime_enabled_features.json5 | 2 +- + 4 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/components/installedapp/android/java/src/org/chromium/components/installedapp/InstalledAppProviderImpl.java b/components/installedapp/android/java/src/org/chromium/components/installedapp/InstalledAppProviderImpl.java +--- a/components/installedapp/android/java/src/org/chromium/components/installedapp/InstalledAppProviderImpl.java ++++ b/components/installedapp/android/java/src/org/chromium/components/installedapp/InstalledAppProviderImpl.java +@@ -155,6 +155,7 @@ public class InstalledAppProviderImpl implements InstalledAppProvider { + @UiThread + public void filterInstalledApps(final RelatedApplication[] relatedApps, final Url manifestUrl, + final FilterInstalledApps_Response callback) { ++ assert false; + GURL url = mRenderFrameHost.getLastCommittedURL(); + final GURL frameUrl = url == null ? GURL.emptyGURL() : url; + int delayMillis = 0; +diff --git a/content/browser/installedapp/installed_app_provider_impl_win.cc b/content/browser/installedapp/installed_app_provider_impl_win.cc +--- a/content/browser/installedapp/installed_app_provider_impl_win.cc ++++ b/content/browser/installedapp/installed_app_provider_impl_win.cc +@@ -112,6 +112,7 @@ void FilterInstalledAppsForWin( + std::vector related_apps, + blink::mojom::InstalledAppProvider::FilterInstalledAppsCallback callback, + const GURL frame_url) { ++ CHECK(true); + ComPtr launcher_statics; + HRESULT hr = base::win::RoActivateInstance( + base::win::ScopedHString::Create(RuntimeClass_Windows_System_Launcher) +diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc +--- a/content/public/common/content_features.cc ++++ b/content/public/common/content_features.cc +@@ -575,12 +575,12 @@ BASE_FEATURE(kInnerFrameCompositorSurfaceEviction, + base::FEATURE_ENABLED_BY_DEFAULT); + + // Kill switch for the GetInstalledRelatedApps API. +-BASE_FEATURE(kInstalledApp, "InstalledApp", base::FEATURE_ENABLED_BY_DEFAULT); ++BASE_FEATURE(kInstalledApp, "InstalledApp", base::FEATURE_DISABLED_BY_DEFAULT); + + // Allow Windows specific implementation for the GetInstalledRelatedApps API. + BASE_FEATURE(kInstalledAppProvider, + "InstalledAppProvider", +- base::FEATURE_ENABLED_BY_DEFAULT); ++ base::FEATURE_DISABLED_BY_DEFAULT); + + // Enable support for isolated web apps. This will guard features like serving + // isolated web apps via the isolated-app:// scheme, and other advanced isolated +diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 +--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 ++++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5 +@@ -1933,9 +1933,9 @@ + name: "FingerprintingCanvasImageDataNoise", + }, + { ++ // disable GetInstalledRelatedApps + name: "InstalledApp", + public: true, +- status: "stable", + base_feature: "none", + }, + { +-- +2.25.1