Skip to content

Commit

Permalink
[C129] [Android] Fix for brave scheme pages
Browse files Browse the repository at this point in the history
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/4d2cab773589a430dfae515994c3e6cad0eb0270

[M129] Disallow VerbatimMatches to open non-navigable URLs by default.

This change prevents non-navigable URLs from being opened upon paste,
refine, autocomplete etc., effectively disallowing accidental execution
of inline javascript: blocks.

The non-navigable (e.g. executable) URIs will be effectively pushed
down on the suggestions list, making them still available, but
moving forward these will require an explicit user action to be
invoked (i.e. the user now has to intentionally tap these suggestions
to initiate the corresponding action).

The change removes redundant test that relies on inline page
injection. This is already covered by another test:
http://shortn/_NG1M484b41

(cherry picked from commit 04938340e1a93e5e5588badd5e01600dd3356d52)

Bug: b/360642942
  • Loading branch information
samartnik committed Sep 17, 2024
1 parent 233422e commit e9fa1e6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions chromium_src/components/omnibox/browser/verbatim_match.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) 2024 The Brave Authors. All rights reserved.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.

#include "components/omnibox/browser/verbatim_match.h"

#include "content/public/common/url_constants.h"

#if BUILDFLAG(IS_ANDROID)
#define kChromeUIScheme kChromeUIScheme, content::kBraveUIScheme
#endif // BUILDFLAG(IS_ANDROID)
#include "src/components/omnibox/browser/verbatim_match.cc"
#if BUILDFLAG(IS_ANDROID)
#undef kChromeUIScheme
#endif // BUILDFLAG(IS_ANDROID)

0 comments on commit e9fa1e6

Please sign in to comment.