Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Fixes torrent download when torrent viewer is disabled
Browse files Browse the repository at this point in the history
Resolves #8452

Auditors: @bsclifton

Test Plan:
- disable Torrent Viewer in preferences
- go to https://webtorrent.io/free-torrents/
- download Big Buck Bunny torrent file
  • Loading branch information
NejcZdovc authored and bsclifton committed Apr 24, 2017
1 parent 15fe6e6 commit e1db234
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const {adBlockResourceName} = require('./adBlock')
const {updateElectronDownloadItem} = require('./browser/electronDownloadItem')
const {fullscreenOption} = require('./common/constants/settingsEnums')
const isThirdPartyHost = require('./browser/isThirdPartyHost')
var extensionState = require('./common/state/extensionState.js')

let appStore = null

Expand Down Expand Up @@ -664,11 +665,17 @@ module.exports.isResourceEnabled = (resourceName, url, isPrivate) => {
// TODO(bridiver) - need to clean up the rest of this so web can
// remove this because it duplicates checks made in siteSettings
// and not all resources are controlled by shields up/down
if (resourceName === 'flash' || resourceName === 'webtorrent') {
if (resourceName === 'flash') {
return true
}

const appState = appStore.getState()

if (resourceName === 'webtorrent') {
const extension = extensionState.getExtensionById(appState, config.torrentExtensionId)
return extension !== undefined ? extension.get('enabled') : false
}

const settings = siteSettings.getSiteSettingsForURL(appState.get('siteSettings'), url)
const tempSettings = siteSettings.getSiteSettingsForURL(appState.get('temporarySiteSettings'), url)

Expand Down

0 comments on commit e1db234

Please sign in to comment.