@@ -122,7 +122,7 @@ function registerForBeforeRequest (session, partition) {
122
122
}
123
123
124
124
if ( ( isMagnetURL ( details ) ) && partition === appConfig . tor . partition ) {
125
- showTorrentBlockedInTorWarning ( details )
125
+ showTorrentBlockedInTorWarning ( details , muonCb )
126
126
return
127
127
}
128
128
@@ -357,13 +357,16 @@ function registerForBeforeSendHeaders (session, partition) {
357
357
} )
358
358
}
359
359
360
- function showTorrentBlockedInTorWarning ( details ) {
360
+ function showTorrentBlockedInTorWarning ( details , muonCb ) {
361
+ const cb = ( ) => muonCb ( { cancel : true } )
361
362
if ( details . tabId ) {
362
363
tabMessageBox . show ( details . tabId , {
363
364
message : `${ locale . translation ( 'torrentBlockedInTor' ) } ` ,
364
365
title : 'Brave' ,
365
366
buttons : [ locale . translation ( 'torrentWarningOk' ) ]
366
- } )
367
+ } , cb )
368
+ } else {
369
+ cb ( )
367
370
}
368
371
}
369
372
@@ -381,7 +384,7 @@ function registerForHeadersReceived (session, partition) {
381
384
return
382
385
}
383
386
if ( ( isTorrentFile ( details ) ) && partition === appConfig . tor . partition ) {
384
- showTorrentBlockedInTorWarning ( details )
387
+ showTorrentBlockedInTorWarning ( details , muonCb )
385
388
return
386
389
}
387
390
const firstPartyUrl = module . exports . getMainFrameUrl ( details )
@@ -670,7 +673,10 @@ function registerForDownloadListener (session) {
670
673
} )
671
674
}
672
675
673
- function registerForMagnetHandler ( session ) {
676
+ function registerForMagnetHandler ( session , partition ) {
677
+ if ( partition === appConfig . tor . partition ) {
678
+ return
679
+ }
674
680
const webtorrentUrl = appUrlUtil . getTorrentExtUrl ( 'webtorrent.html' )
675
681
try {
676
682
if ( getSetting ( settings . TORRENT_VIEWER_ENABLED ) ) {
0 commit comments