diff --git a/app/brave_main_delegate.cc b/app/brave_main_delegate.cc index 63937f1ac036..744eb345601b 100644 --- a/app/brave_main_delegate.cc +++ b/app/brave_main_delegate.cc @@ -114,6 +114,7 @@ bool BraveMainDelegate::BasicStartupComplete(int* exit_code) { command_line.AppendSwitch(switches::kEnableTabAudioMuting); command_line.AppendSwitch(switches::kDisableDomainReliability); command_line.AppendSwitch(switches::kDisableChromeGoogleURLTrackingClient); + command_line.AppendSwitch(switches::kNoPings); std::stringstream enabled_features; enabled_features << features::kEnableEmojiContextMenu.name diff --git a/app/brave_main_delegate_browsertest.cc b/app/brave_main_delegate_browsertest.cc index 73f71abd3609..1341e1af88bc 100644 --- a/app/brave_main_delegate_browsertest.cc +++ b/app/brave_main_delegate_browsertest.cc @@ -3,10 +3,13 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/common/chrome_switches.h" #include "chrome/browser/domain_reliability/service_factory.h" #include "components/domain_reliability/service.h" +#include "content/public/browser/render_view_host.h" +#include "content/public/common/web_preferences.h" using BraveMainDelegateBrowserTest = InProcessBrowserTest; @@ -16,3 +19,13 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DomainReliabilityServiceDis ASSERT_EQ(domain_reliability::DomainReliabilityServiceFactory::GetForBrowserContext( ((content::BrowserContext *)browser()->profile())), nullptr); } + +IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisableHyperlinkAuditing) { + EXPECT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kNoPings)); + content::WebContents* contents = + browser()->tab_strip_model()->GetActiveWebContents(); + const content::WebPreferences prefs = + contents->GetRenderViewHost()->GetWebkitPreferences(); + EXPECT_FALSE(prefs.hyperlink_auditing_enabled); +}