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

Fix Brave content settings page crash #9997

Merged
merged 3 commits into from
Sep 8, 2021
Merged

Conversation

darkdh
Copy link
Member

@darkdh darkdh commented Sep 8, 2021

Resolves brave/brave-browser#17808

  1. ContentSettingsTypes is no longer accessible directly in site_details.js and privacy_pages.js, we have to get the type through contentSettingsTypesEnum_ due to https://chromium-review.googlesource.com/c/chromium/src/+/2997906
  2. AUTOPLAY should be added to VisiblePermissionCategories so it can be shown in site details page, related upstream change https://chromium-review.googlesource.com/c/chromium/src/+/2915454
  3. Eliminate some AUTOPLAY polymer patches
  4. Add Ethereum request to site details

Screen Shot 2021-09-07 at 19 25 34

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • 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, npm run lint, 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:

Autoplay

Crash

  1. Go to brave://settings/content/autoplay
  2. Brave should not crash

Site details

  1. Go to brave://settings/content/siteDetails?site=https%3A%2F%2Fbrave.com
  2. Autoplay should be in permission list

Ethereum request

Crash

  1. Go brave://flags/#native-brave-wallet and enable native wallet
  2. Go to brave://settings/content/ethereum
  3. Brave should not crash

Site details

  1. Go to brave://settings/content/siteDetails?site=https%3A%2F%2Fbrave.com
  2. There is no Ethereum permission in the list
  3. Go brave://flags/#native-brave-wallet and enable native wallet
  4. Go to brave://settings/content/siteDetails?site=https%3A%2F%2Fbrave.com
  5. Ethereum should be in permission list

@darkdh darkdh requested a review from a team as a code owner September 8, 2021 02:17
@darkdh darkdh self-assigned this Sep 8, 2021
@darkdh darkdh requested a review from a team as a code owner September 8, 2021 02:17
Copy link
Member

@yrliou yrliou 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
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.

LGTM

@darkdh darkdh merged commit 588b185 into master Sep 8, 2021
@darkdh darkdh deleted the brave-content-settings-page branch September 8, 2021 20:14
@darkdh darkdh added this to the 1.31.x - Nightly milestone Sep 8, 2021
brave-builds pushed a commit that referenced this pull request Sep 8, 2021
brave-builds pushed a commit that referenced this pull request Sep 8, 2021
@kjozwiak
Copy link
Member

kjozwiak commented Sep 9, 2021

Verification PASSED on Win 10 x64 using the following build:

Brave | 1.31.29 Chromium: 93.0.4577.63 (Official Build) nightly (64-bit)
-- | --
Revision | ff5c0da2ec0adeaed5550e6c7e98417dac77d98a-refs/branch-heads/4577@{#1135}
OS | Windows 10 OS Version 2009 (Build 19042.1165)

Autoplay Test Cases

Crash

  • opened brave://settings/content/autoplay and ensured that Brave didn't crash (waiting ~30s as well)

Site details

autoplaySettings

Ethereum request

Crash

  • enabled native ethereum wallet via brave://flags/#native-brave-wallet and restarted brave
  • opened brave://settings/content/ethereum and ensured that Brave didn't crash (waiting ~30s as well)

Site details

Example Disabled Example Enabled
disabledEth ethAvailable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Brave crashes when opening the autoplay settings
4 participants