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
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)
Brave should not intercept requests for .torrent files unless they are top-level navigation requests.
Easily reproduced
Version 0.66.101 Chromium: 75.0.3770.142 (Official Build) (64-bit)
WebTorrent users reporting the issue here: https://github.com/webtorrent/webtorrent/issues/1649
This also fixes this old issue: https://github.com/brave/browser-laptop/issues/10672
@feross just a quick double check. When opening https://codepen.io/yciabaud/pen/XdOeWM while WebTorrent is enabled, it looks like the client-side JS library loads the .torrent and starts downloading it as per:

Is the above the expected behaviour? When you have WebTorrent either enabled or disabled, you'll get the above and Brave will start loading the .torrent.
@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.
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)
WebTorrent is both enabled and disabled as per https://github.com/brave/brave-browser/issues/5361#issuecomment-532529740Verification 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
WebTorrent is both enabled and disabled as per https://github.com/brave/brave-browser/issues/5361#issuecomment-532529740Verification 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)
WebTorrent is both enabled and disabled as per https://github.com/brave/brave-browser/issues/5361#issuecomment-532529740