Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

block chrome://brave and brave:// loads in tabs #15261

Merged
merged 3 commits into from
Oct 5, 2018
Merged

Conversation

diracdeltas
Copy link
Member

fix #15237

Test Plan:
will DM to QA

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed. (Ask a Brave employee to help if you cannot access this document.)

Test Plan:

Reviewer Checklist:

  • Request a security/privacy review as needed if one was not already requested.

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@diracdeltas diracdeltas added this to the 0.25.0 milestone Oct 3, 2018
@diracdeltas diracdeltas self-assigned this Oct 3, 2018
@diracdeltas diracdeltas requested a review from bridiver October 3, 2018 20:20
Test Plan:
will DM to QA
app/filtering.js Outdated
@@ -118,6 +118,11 @@ if (process.env.NODE_ENV === 'development') {
function registerForBeforeRequest (session, partition) {
const isPrivate = module.exports.isPrivate(partition)
session.webRequest.onBeforeRequest((details, muonCb) => {
if (details.url && details.url.includes('chrome://brave/') &&
details.tabId !== -1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

tabs can be -1 here for renderer initiated new tabs/windows that start to load before they are assigned to a window

app/filtering.js Outdated
@@ -118,6 +118,11 @@ if (process.env.NODE_ENV === 'development') {
function registerForBeforeRequest (session, partition) {
const isPrivate = module.exports.isPrivate(partition)
session.webRequest.onBeforeRequest((details, muonCb) => {
if (details.url && details.url.includes('chrome://brave/') &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should also check against brave://

use startsWith instead of includes because these are valid strings in
a URL path
@diracdeltas
Copy link
Member Author

added brave://

@diracdeltas diracdeltas changed the title block chrome://brave loads in tabs block chrome://brave and brave:// loads in tabs Oct 4, 2018
@bsclifton bsclifton merged commit 907c7e4 into master Oct 5, 2018
@bsclifton bsclifton deleted the fix/chrome-brave branch October 5, 2018 05:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[hackerone] chrome://brave issues
3 participants