question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Brave should not intercept non-navigation .torrent file requests

See original GitHub issue

Description

If a web page embeds the WebTorrent client-side JS library and attempts to load a .torrent file using an XHR request or fetch, Brave will intercept the .torrent file load and replace it with the chrome-extension HTML, breaking the site. This is true not just for the WebTorrent JS library but for any request to fetch a .torrent file.

There’s a CodePen that demonstrates this here: https://codepen.io/yciabaud/pen/XdOeWM

Steps to Reproduce

  1. Visit https://codepen.io/yciabaud/pen/XdOeWM
  2. The torrent demo should fail with an error in the console.
  3. Now, disable the WebTorrent extension in Brave settings.
  4. The demo now works.

Actual result:

Uncaught Error: Error downloading torrent: XHR error
    at VM37 webtorrent.min.js:5
    at t.exports.<anonymous> (VM37 webtorrent.min.js:7)
    at t.exports.t (VM37 webtorrent.min.js:5)
    at t.exports.r.emit (VM37 webtorrent.min.js:4)
    at XMLHttpRequest.c.onerror (VM37 webtorrent.min.js:7)

Expected result:

Brave should not intercept requests for .torrent files unless they are top-level navigation requests.

Reproduces how often:

Easily reproduced

Brave version (brave://version info)

Version 0.66.101 Chromium: 75.0.3770.142 (Official Build) (64-bit)

Version/Channel Information:

  • Can you reproduce this issue with the current release? Yes
  • Can you reproduce this issue with the beta channel?
  • Can you reproduce this issue with the dev channel?
  • Can you reproduce this issue with the nightly channel?

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields?
  • Does the issue resolve itself when disabling Brave Rewards?
  • Is the issue reproducible on the latest version of Chrome?

Miscellaneous Information:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kjozwiakcommented, Sep 19, 2019

Verification PASSED on macOS 10.14.6 x64 using the following build:

Brave 0.69.126 Chromium: 77.0.3865.65 (Official Build) (64-bit)
Revision 87a331a3169cab563505fb44011058b904011ba1-refs/branch-heads/3865@{#726}
OS macOS Version 10.14.6 (Build 18G95)

Verification passed on

Brave 0.69.127 Chromium: 77.0.3865.75 (Official Build) (64-bit)
Revision 201e747d032611c5f2785cae06e894cf85be7f8a-refs/branch-heads/3865@{#776}
OS Ubuntu 18.04 LTS

Verification passed on

Brave 0.69.128 Chromium: 77.0.3865.75 (Official Build) (64-bit)
Revision 201e747d032611c5f2785cae06e894cf85be7f8a-refs/branch-heads/3865@{#776}
OS Windows 10 OS Version 1803 (Build 17134.1006)
1reaction
ferosscommented, Sep 18, 2019

@kjozwiak Yep, this is expected behavior. This is JavaScript code running on the website itself and has nothing to do with the built-in WebTorrent implementation in Brave. It’s supposed to work in both cases – when the WebTorrent extension is enabled or disabled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Torrenting within Brave? Is this new? Is it safe?
Hi. So I noticed something that surprised me. Brave can download Torrent files (or Magnets) straight in the browser. Curious about this: is ......
Read more >
Torrent Datas Showing - Brave Feature Requests
Brave needs a feature that allows you too see more informations about the torrents you are downloading, as qbittorrent, it should show who ......
Read more >
Torrent save location - don't save to RAM - Brave Community
Today, i have been trying to download a few torrents simultaneously, to all have them crash for either a memory shortage (the ram...
Read more >
Torrents should be immediately downloaded - Brave Community
If I'm downloading a torrent, isn't it safe to assume that I plan on keeping it, not just seeding it?
Read more >
Turn Off Brave Torrents - Desktop Requests
I want to use my own torrent client to handle torrent and magnet link. On Chrome, I just click on a torrent link...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found