Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning text if the user has currently selected Block all cookies #27090

Conversation

vadimstruts
Copy link
Collaborator

@vadimstruts vadimstruts commented Dec 24, 2024

Resolves brave/brave-browser#42295
Resolves brave/brave-browser#42062

  • added cookie policy setting and script blocking to the webcompat report
  • added a warning text with learn more link under the Block all cookies toggle (for Desktop, Android iOS).
Platform Screenshot
Desktop image
Android image
iOS image

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

cookie policy setting and script blocking fields in the webcompat report

  • send webcompat report
  • check the attached JSON for the new fields:
    "block_scripts" - should contain value "true" or "false" depends from the settings
    "cookie_policy" - should contain next possible values: "block" or "block_third_party" or "allow" (For Desktop or Android), or as for IOS it could contain value "block" otherwise it should not be present

@github-actions github-actions bot added the CI/run-upstream-tests Run upstream unit and browser tests on Linux and Windows (otherwise only on Linux) label Dec 24, 2024
@vadimstruts vadimstruts marked this pull request as ready for review December 30, 2024 22:44
@vadimstruts vadimstruts requested review from deeppandya and a team as code owners December 30, 2024 22:44
@@ -21,6 +21,8 @@ inline constexpr char kLanguageFarblingField[] = "languageFarblingEnabled";
inline constexpr char kBraveVPNEnabledField[] = "braveVPNEnabled";
inline constexpr char kChannelField[] = "channel";
inline constexpr char kVersionField[] = "version";
inline constexpr char kCookiePolicyField[] = "cookie_policy";
inline constexpr char kBlockScriptsField[] = "block_scripts";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add these fields on the server-side. Please remember to update https://github.com/brave/brave-browser/wiki/Web-compatibility-reports

Copy link
Contributor

@deeppandya deeppandya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

github-actions bot commented Jan 5, 2025

The security team is monitoring all repositories for certain keywords. This PR includes the word(s) "policy" and so security team members have been added as reviewers to take a look.

No need to request a full security review at this stage, the security team will take a look shortly and either clear the label or request more information/changes.

Notifications have already been sent, but if this is blocking your merge feel free to reach out directly to the security team on Slack so that we can expedite this check.

Copy link
Collaborator

@DJAndries DJAndries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, thanks

Comment on lines 479 to 484
<message name="IDS_SETTINGS_BRAVE_SHIELDS_COOKIE_CONTROL_BLOCK_ALL_DEPRECATED_LABEL" desc="Block all cookies deprecation warning">
Block all cookies option is deprecated. To force-enable,
</message>
<message name="IDS_SETTINGS_BRAVE_SHIELDS_COOKIE_CONTROL_BLOCK_ALL_DEPRECATED_LINK_LABEL" desc="Block all cookies learn more link text">
Learn more
</message>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The To force-enable, Learn more part doesn't look right to me. Also, because this warning is shown with the setting itself, I don't think repeating Block all cookies is necessary. I would suggest perhaps:

This option is deprecated. <link>Learn how to force-enable</link>

cc: @rmcfadden3 WDYT?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkarolin how about The "Block all Cookies" option has been deprecated. To learn how to force-enable this option, visit [our help page](https://support.brave.com/).

Note that I just used the general support.brave.com link as a placeholder on the href. We should obviously embed the exact URL once we have it.

If the goal is to send someone to Flags or something, rather than help center, LMK and I can tweak the copy accordingly.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rmcfadden3! Sounds good to me.

Comment on lines 1552 to 1557
<message name="IDS_BLOCK_COOKIES_DEPRECATED_LABEL" desc="Block all cookies deprecation warning">
Block all cookies option is deprecated. To force-enable,
</message>
<message name="IDS_BLOCK_COOKIES_DEPRECATED_LINK_LABEL" desc="Block all cookies deprecation warning link">
<ph name="BEGIN_LINK_1">&lt;LINK_1&gt;</ph> learn more<ph name="END_LINK_1">&lt;/LINK_1&gt;</ph>
</message>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the desktop.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated strings & screenshots above

Comment on lines 479 to 484
<message name="IDS_SETTINGS_BRAVE_SHIELDS_COOKIE_CONTROL_BLOCK_ALL_DEPRECATED_LABEL" desc="Block all cookies deprecation warning">
The "Block all Cookies" option has been deprecated. To learn how to force-enable this option, visit
</message>
<message name="IDS_SETTINGS_BRAVE_SHIELDS_COOKIE_CONTROL_BLOCK_ALL_DEPRECATED_LINK_LABEL" desc="Block all cookies learn more link text">
our help page
</message>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not great for localization when a sentence is split up between strings. It is better to use placeholders like you have in the Android file, but it should be all in one string (both here and in the Android file).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
Signed-off-by: Vadym Struts <[email protected]>
@vadimstruts vadimstruts force-pushed the 42295-warning-text-if-the-user-has-currently-selected-block-all-cookies branch from 11cccab to f859e52 Compare January 8, 2025 18:16
Signed-off-by: Vadym Struts <[email protected]>
Comment on lines 1552 to 1557
<message name="IDS_BLOCK_COOKIES_DEPRECATED_LABEL" desc="Block all cookies deprecation warning">
The "Block all Cookies" option has been deprecated. To learn how to force-enable this option, visit
</message>
<message name="IDS_BLOCK_COOKIES_DEPRECATED_LINK_LABEL" desc="Block all cookies deprecation warning link">
<ph name="BEGIN_LINK_1">&lt;LINK_1&gt;</ph> our help page<ph name="END_LINK_1">&lt;/LINK_1&gt;</ph>
</message>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, @vadimstruts but can you merge these into one as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, thanks, I missed it. Done

Signed-off-by: Vadym Struts <[email protected]>
Copy link
Collaborator

@mkarolin mkarolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strings++ Thanks!

@vadimstruts vadimstruts merged commit 53b345a into master Jan 10, 2025
18 checks passed
@vadimstruts vadimstruts deleted the 42295-warning-text-if-the-user-has-currently-selected-block-all-cookies branch January 10, 2025 12:49
@github-actions github-actions bot added this to the 1.76.x - Nightly milestone Jan 10, 2025
@brave-builds
Copy link
Collaborator

Released in v1.76.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/run-upstream-tests Run upstream unit and browser tests on Linux and Windows (otherwise only on Linux)
Projects
None yet
10 participants