-
Notifications
You must be signed in to change notification settings - Fork 873
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent loading sync ui in private window
Currently, brave sync ui isn't allowed to load in private window. That only works properly in normal window.
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc | ||
index 57cc96c276c1106079828b5e359a3d88e1c901ce..81baaee0fdad10d4b1f4dc17889a44550083ee46 100644 | ||
--- a/chrome/browser/ui/browser_navigator.cc | ||
+++ b/chrome/browser/ui/browser_navigator.cc | ||
@@ -707,6 +707,16 @@ bool IsHostAllowedInIncognito(const GURL& url) { | ||
host != chrome::kChromeUISuggestionsHost; | ||
} | ||
|
||
+#if defined(BRAVE_CHROMIUM_BUILD) | ||
+ DCHECK(!url.SchemeIs(content::kBraveUIScheme)) | ||
+ << "brave url should not be reached here. scheme mapping should be done " | ||
+ "before. Use chrome scheme for this url: " | ||
+ << url.spec(); | ||
+ // sync page is not allowed in private window. | ||
+ if (host == kBraveUISyncHost) | ||
+ return false; | ||
+#endif | ||
+ | ||
if (scheme != content::kChromeUIScheme) | ||
return true; | ||
|