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

Only handle torrent URLs when WebTorrent extension is enabled #832

Merged
merged 5 commits into from
Nov 8, 2018

Conversation

yrliou
Copy link
Member

@yrliou yrliou commented Nov 8, 2018

Fix brave/brave-browser#2043
See also brave/brave-browser#2045 for adding disable_webtorrent_extension into npm start options.
This PR add checks in the backend so we will only redirect/rewrite magnet/torrent URLs when webtorrent extension is enabled.
A command line switch is also added to disable webtorrent extension.

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).
  • Verified that these changes build without errors on
    • Windows
    • macOS
    • Linux
  • Verified that these changes pass automated tests (npm test brave_unit_tests && npm test brave_browser_tests) on
    • Windows
    • macOS
    • Linux
  • Ran git rebase master (if needed).
  • 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. Open the app from command line and pass --disable-webtorrent-extension
  2. Visit https://webtorrent.io/free-torrents, click a torrent link will prompt to download the file
  3. Click a magnet link will prompt to open it using your default application (ex: uTorrent)
  4. Right click a magnet link to open it in a new tab, it will prompt to open it using your default application in the new tab.

npm test brave_browser_tests -- --filter=BraveContentBrowserClientTest.*

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 Nov 8, 2018
@yrliou yrliou changed the title WIP: Only handle magnet/torrent URLs when WebTorrent extension is enabled WIP: Only handle torrent URLs when WebTorrent extension is enabled Nov 8, 2018
@yrliou yrliou changed the title WIP: Only handle torrent URLs when WebTorrent extension is enabled Only handle torrent URLs when WebTorrent extension is enabled Nov 8, 2018
@yrliou yrliou merged commit 522accc into master Nov 8, 2018
yrliou added a commit that referenced this pull request Nov 8, 2018
Only handle torrent URLs when WebTorrent extension is enabled
@yrliou
Copy link
Member Author

yrliou commented Nov 8, 2018

master: 522accc
0.58.x: d4ae08e

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.

Only handle torrent URLs when WebTorrent extension is enabled
2 participants