From f5583492d9766f2e2bdac6f447ecaf8fde0ccd20 Mon Sep 17 00:00:00 2001 From: Pavel Beloborodov <73575789+boocmp@users.noreply.github.com> Date: Sat, 18 Nov 2023 23:01:00 +0700 Subject: [PATCH] Added --enable-distillability-service arg to the command line. (#21013) * Added --enable-distillability-service arg to the command line. --- browser/speedreader/speedreader_browsertest.cc | 1 - chromium_src/chrome/app/chrome_main_delegate.cc | 1 + .../chrome/renderer/chrome_content_renderer_client.cc | 6 ++++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/browser/speedreader/speedreader_browsertest.cc b/browser/speedreader/speedreader_browsertest.cc index 386a2817d88..11c198159b9 100644 --- a/browser/speedreader/speedreader_browsertest.cc +++ b/browser/speedreader/speedreader_browsertest.cc @@ -792,7 +792,6 @@ class SpeedReaderWithDistillationServiceBrowserTest public: void SetUpCommandLine(base::CommandLine* command_line) override { SpeedReaderBrowserTest::SetUpCommandLine(command_line); - command_line->AppendSwitch(switches::kEnableDistillabilityService); } }; diff --git a/chromium_src/chrome/app/chrome_main_delegate.cc b/chromium_src/chrome/app/chrome_main_delegate.cc index 653900af06c..64e622724ac 100644 --- a/chromium_src/chrome/app/chrome_main_delegate.cc +++ b/chromium_src/chrome/app/chrome_main_delegate.cc @@ -57,6 +57,7 @@ absl::optional ChromeMainDelegate::BasicStartupComplete() { BraveCommandLineHelper command_line(base::CommandLine::ForCurrentProcess()); command_line.AppendSwitch(switches::kDisableDomainReliability); command_line.AppendSwitch(switches::kEnableDomDistiller); + command_line.AppendSwitch(switches::kEnableDistillabilityService); if (!base::CommandLine::ForCurrentProcess()->HasSwitch( embedder_support::kOriginTrialPublicKey)) { diff --git a/chromium_src/chrome/renderer/chrome_content_renderer_client.cc b/chromium_src/chrome/renderer/chrome_content_renderer_client.cc index 2f9a86061d8..b29972fa892 100644 --- a/chromium_src/chrome/renderer/chrome_content_renderer_client.cc +++ b/chromium_src/chrome/renderer/chrome_content_renderer_client.cc @@ -6,6 +6,7 @@ #include "brave/components/ai_chat/core/common/buildflags/buildflags.h" #include "brave/components/content_settings/renderer/brave_content_settings_agent_impl.h" #include "chrome/common/chrome_isolated_world_ids.h" +#include "components/dom_distiller/content/renderer/distillability_agent.h" #include "components/feed/content/renderer/rss_link_reader.h" #include "content/public/common/isolated_world_ids.h" @@ -36,6 +37,11 @@ void RenderFrameWithBinderRegistryCreated( #define BRAVE_RENDER_FRAME_CREATED \ RenderFrameWithBinderRegistryCreated(render_frame, registry); +// Prevents unnecessary js console logs spam. +#define DistillabilityAgent(render_frame, dcheck_is_on) \ + DistillabilityAgent(render_frame, false) + #include "src/chrome/renderer/chrome_content_renderer_client.cc" #undef BRAVE_RENDER_FRAME_CREATED +#undef DistillabilityAgent