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

Disable WebTorrent in Tor profile #554

Merged
merged 3 commits into from
Oct 3, 2018
Merged

Conversation

yrliou
Copy link
Member

@yrliou yrliou commented Oct 2, 2018

Fix brave/brave-browser#1134
Don't redirect magnet and .torrent URLs to webtorrent component extension in Tor profile so they won't use WebTorrent.
Only added tests in brave_torrent_redirect_network_delegate_helper for .torrent case but didn't add tests for IsWebtorrentEnabled change because it's quite trivial.

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.
  • Add appropriate QA labels (QA/Yes or QA/No) to include the closed issue in milestone

Test Plan:

manual test:

  1. Click "Open Tor Window" under user's profile image and visit https://webtorrent.io/free-torrents in the tor window
  2. Click a torrent file link will prompt to download the torrent file
  3. Click a magnet link will prompt to ask if user wants to open his/her default external application for magnet links like below.

screen shot 2018-10-02 at 4 48 38 pm

4. Right click a magnet link to open it in a new tab will shows the same prompt as 3 in the new tab.

unit test:
npm run test -- brave_unit_tests --filter=BraveTorrentRedirectNetworkDelegateHelperTest.*

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

@yrliou yrliou self-assigned this Oct 2, 2018
@yrliou yrliou changed the title WIP: Disable WebTorrent in Tor profile Disable WebTorrent in Tor profile Oct 3, 2018
@yrliou yrliou requested review from darkdh and bbondy October 3, 2018 18:24
return false;
}

return ui_data->GetTorProfileService();
Copy link
Member

Choose a reason for hiding this comment

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

can we do something like return ui_data->GetTorProfileService() ? true : false;

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, addressed in df81708

Copy link
Member

@darkdh darkdh left a comment

Choose a reason for hiding this comment

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

++

@yrliou yrliou merged commit 65e87e0 into master Oct 3, 2018
yrliou added a commit that referenced this pull request Oct 3, 2018
yrliou added a commit that referenced this pull request Oct 3, 2018
@yrliou
Copy link
Member Author

yrliou commented Oct 3, 2018

master: 65e87e0
0.55.x: 770075f
0.56.x: fd88e2a

@yrliou yrliou deleted the disable_webtorrent_in_tor branch October 3, 2018 20:32
@bbondy bbondy added this to the 0.55.x - Release milestone Jan 14, 2019
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.

Don't open webtorrent in tor windows
3 participants