Skip to content

Commit

Permalink
Toned down interstitials for top-level blocking.
Browse files Browse the repository at this point in the history
Also, switched to Chromium's information (i) icon instead of the red
exclamation point.

Fixes brave/brave-browser#15433
  • Loading branch information
mkarolin committed Apr 22, 2021
1 parent 153e146 commit f6335b3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions browser/brave_shields/domain_block_page_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ IN_PROC_BROWSER_TEST_F(DomainBlockTest, ShowInterstitialAndProceed) {

// Simulate click on "Proceed anyway" button. This should navigate to the
// originally requested page.
ClickAndWaitForNavigation("proceed-button");
ClickAndWaitForNavigation("primary-button");
ASSERT_FALSE(IsShowingInterstitial());
base::string16 expected_title = base::ASCIIToUTF16("OK");
content::TitleWatcher watcher(web_contents(), expected_title);
Expand Down Expand Up @@ -180,7 +180,7 @@ IN_PROC_BROWSER_TEST_F(DomainBlockTest, ProceedAndReload) {

// Simulate click on "Proceed anyway" button. This should navigate to the
// originally requested page.
ClickAndWaitForNavigation("proceed-button");
ClickAndWaitForNavigation("primary-button");
ASSERT_FALSE(IsShowingInterstitial());
base::string16 expected_title = base::ASCIIToUTF16("OK");
content::TitleWatcher watcher(web_contents(), expected_title);
Expand Down Expand Up @@ -213,7 +213,7 @@ IN_PROC_BROWSER_TEST_F(DomainBlockTest, ProceedDoesNotAffectNewTabs) {

// Simulate click on "Proceed anyway" button. This should navigate to the
// originally requested page.
ClickAndWaitForNavigation("proceed-button");
ClickAndWaitForNavigation("primary-button");
ASSERT_FALSE(IsShowingInterstitial());
base::string16 expected_title = base::ASCIIToUTF16("OK");
content::TitleWatcher watcher(web_contents(), expected_title);
Expand Down Expand Up @@ -252,7 +252,7 @@ IN_PROC_BROWSER_TEST_F(DomainBlockTest, DontWarnAgainAndProceed) {

// Simulate click on "Proceed anyway" button. This should save the "don't warn
// again" choice and navigate to the originally requested page.
ClickAndWaitForNavigation("proceed-button");
ClickAndWaitForNavigation("primary-button");
WaitForAdBlockServiceThreads();
ASSERT_FALSE(IsShowingInterstitial());
base::string16 expected_title = base::ASCIIToUTF16("OK");
Expand Down Expand Up @@ -292,7 +292,7 @@ IN_PROC_BROWSER_TEST_F(DomainBlockTest, ShowInterstitialAndGoBack) {

// Simulate click on "Go back" button. This should return to previous page on
// a.com.
ClickAndWaitForNavigation("primary-button");
ClickAndWaitForNavigation("back-button");
ASSERT_FALSE(IsShowingInterstitial());
EXPECT_EQ(web_contents()->GetURL().host(), "a.com");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

.domainblock .icon {
background-image: -webkit-image-set(
url(../../../../components/security_interstitials/core/browser/resources/images/1x/triangle_red.png) 1x,
url(../../../../components/security_interstitials/core/browser/resources/images/2x/triangle_red.png) 2x);
url(../../../../components/security_interstitials/core/browser/resources/images/1x/info.png) 1x,
url(../../../../components/security_interstitials/core/browser/resources/images/2x/info.png) 2x);
}

.domainblock #domain {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!doctype html>
<head>
<meta charset="utf-8">
<meta name="theme-color" content="#fff">
Expand Down Expand Up @@ -27,8 +27,8 @@ <h1>$i18nRaw{heading}</h1>
</div>
</div>
<div class="nav-wrapper">
<button id="primary-button" class="primary-button">$i18n{goBackText}</button>
<button id="proceed-button" class="proceed-button secondary-button"">$i18n{proceedAnywayText}</button>
<button id="primary-button" class="primary-button">$i18n{proceedAnywayText}</button>
<button id="back-button" class="back-button secondary-button">$i18n{goBackText}</button>
</div>
</div>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

function setupEvents() {
$('primary-button').addEventListener('click', function() {
sendCommand(SecurityInterstitialCommandId.CMD_DONT_PROCEED);
});
$('proceed-button').addEventListener('click', function() {
sendCommand(SecurityInterstitialCommandId.CMD_PROCEED);
});
$('back-button').addEventListener('click', function() {
sendCommand(SecurityInterstitialCommandId.CMD_DONT_PROCEED);
});
$('dont-warn-again-checkbox').addEventListener('click', function() {
sendCommand($('dont-warn-again-checkbox').checked ?
SecurityInterstitialCommandId.CMD_DO_REPORT :
Expand Down
4 changes: 2 additions & 2 deletions components/resources/domain_block_strings.grdp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
Domain Blocked
</message>
<message name="IDS_DOMAIN_BLOCK_HEADING" desc="Heading of domain block interstitial page.">
Suspicious site ahead
This site may attempt to track you across other sites
</message>
<message name="IDS_DOMAIN_BLOCK_PRIMARY_PARAGRAPH" desc="Main paragraph of domain block interstitial page.">
Brave has prevented the following site from loading:
</message>
<message name="IDS_DOMAIN_BLOCK_EXPLANATION" desc="Second paragraph of domain block interstitial page.">
This site may be fraudulent, bounce you between various sites to set tracking cookies, or perform other privacy invasive actions.
This site may try to link some of your personal data with a cookie before showing the content.
</message>
<message name="IDS_DOMAIN_BLOCK_DONT_WARN_AGAIN_BUTTON" desc="The text for the domain block interstitial don't warn again checkbox.">
Don't warn me about this site again
Expand Down

0 comments on commit f6335b3

Please sign in to comment.