Skip to content

Commit

Permalink
Disable hyperlink auditing by appending kNoPings option
Browse files Browse the repository at this point in the history
This option disables sending pings for anchor elements
  • Loading branch information
simonhong committed Aug 20, 2018
1 parent 0126337 commit d6ed3e5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/brave_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions app/brave_main_delegate_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}

0 comments on commit d6ed3e5

Please sign in to comment.