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

Setting tor path relative to browser laptop #13455

Merged
merged 1 commit into from
Mar 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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