Skip to content

Commit

Permalink
[Settings UI] Fixes hiding of the privacy sandbox link.
Browse files Browse the repository at this point in the history
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/5bd9ec7b1110bc1f0459577665fe60a73c04bbdf

commit 5bd9ec7b1110bc1f0459577665fe60a73c04bbdf
Author: Ehimare Okoyomon <[email protected]>
Date:   Tue Mar 1 12:31:48 2022 +0000

    Privacy Sandbox Settings: Make page inaccessible for restricted users

    Bug: 1286276
  • Loading branch information
mkarolin committed Apr 15, 2022
1 parent 6165e99 commit 007dec1
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions browser/resources/settings/brave_overrides/privacy_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,24 @@ RegisterPolymerTemplateModifications({
}
}

const privacySandboxLinkRow = templateContent.getElementById('privacySandboxLinkRow')
if (!privacySandboxLinkRow) {
console.error('[Brave Settings Overrides] Could not find privacySandboxLinkRow id on privacy page.')
} else {
privacySandboxLinkRow.setAttribute('hidden', 'true')
if (!loadTimeData.getBoolean('isPrivacySandboxRestricted')) {
const privacySandboxTemplate = templateContent.querySelector(`template[if*='isPrivacySandboxRestricted_']`)
if (!privacySandboxTemplate) {
console.error('[Brave Settings Overrides] Could not find template with if*=isPrivacySandboxRestricted_ on privacy page.')
} else {
const privacySandboxLinkRow = privacySandboxTemplate.content.getElementById('privacySandboxLinkRow')
if (!privacySandboxLinkRow) {
console.error('[Brave Settings Overrides] Could not find privacySandboxLinkRow id on privacy page.')
} else {
privacySandboxLinkRow.setAttribute('hidden', 'true')
}
const privacySandboxLink = privacySandboxTemplate.content.getElementById('privacySandboxLink')
if (!privacySandboxLink) {
console.error('[Brave Settings Overrides] Could not find privacySandboxLink id on privacy page.')
} else {
privacySandboxTemplate.setAttribute('hidden', 'true')
}
}
}
},
})

0 comments on commit 007dec1

Please sign in to comment.