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

Commit

Permalink
Tor binary path will be passed from browser-laptop
Browse files Browse the repository at this point in the history
  • Loading branch information
jumde committed Mar 16, 2018
1 parent f074333 commit ec1d9a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/browser/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const appActions = require('../../js/actions/appActions')
const windowActions = require('../../js/actions/windowActions')
const tabActions = require('../common/actions/tabActions')
const config = require('../../js/constants/config')
const {getExtensionsPath} = require('../../js/lib/appUrlUtil')
const Immutable = require('immutable')
const { shouldDebugTabEvents } = require('../cmdLine')
const tabState = require('../common/state/tabState')
Expand Down Expand Up @@ -39,6 +40,7 @@ const bookmarkOrderCache = require('../common/cache/bookmarkOrderCache')
const ledgerState = require('../common/state/ledgerState')
const {getWindow} = require('./windows')
const activeTabHistory = require('./activeTabHistory')
const path = require('path')

let adBlockRegions
let currentPartitionNumber = 0
Expand Down Expand Up @@ -1015,6 +1017,11 @@ const api = {
createProperties.isolated_storage = true
createProperties.parent_partition = ''
createProperties.tor_proxy = 'socks5://127.0.0.1:9050'
if (process.platform === 'win32') {
createProperties.tor_path = '"' + path.join(getExtensionsPath('bin'), 'tor.exe') + '"'
} else {
createProperties.tor_path = path.join(getExtensionsPath('bin'), 'tor')
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions app/filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const hostContentSettings = require('./browser/contentSettings/hostContentSettin
const downloadStates = require('../js/constants/downloadStates')
const urlParse = require('./common/urlParse')
const getSetting = require('../js/settings').getSetting
const {getExtensionsPath} = require('../js/lib/appUrlUtil')
const appUrlUtil = require('../js/lib/appUrlUtil')
const siteSettings = require('../js/state/siteSettings')
const settings = require('../js/constants/settings')
Expand Down Expand Up @@ -691,6 +692,11 @@ const initPartition = (partition) => {
options.isolated_storage = true
options.parent_partition = ''
options.tor_proxy = 'socks5://127.0.0.1:9050'
if (process.platform === 'win32') {
options.tor_path = '"' + path.join(getExtensionsPath('bin'), 'tor.exe') + '"'
} else {
options.tor_path = path.join(getExtensionsPath('bin'), 'tor')
}
}

let ses = session.fromPartition(partition, options)
Expand Down

0 comments on commit ec1d9a4

Please sign in to comment.