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

Commit

Permalink
bind tor new circuit to hard refresh in tor tabs
Browse files Browse the repository at this point in the history
fix #13925
  • Loading branch information
diracdeltas committed Apr 30, 2018
1 parent 58b859d commit d43a263
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 5 additions & 2 deletions app/filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const electron = require('electron')
const session = electron.session
const BrowserWindow = electron.BrowserWindow
const webContents = electron.webContents
const webContentsCache = require('./browser/webContentsCache')
const appActions = require('../js/actions/appActions')
const appConfig = require('../js/constants/appConfig')
const hostContentSettings = require('./browser/contentSettings/hostContentSettings')
Expand Down Expand Up @@ -662,8 +663,10 @@ module.exports.setTorNewIdentity = (url, tabId) => {
return
}
ses.setTorNewIdentity(url, () => {
const tab = webContents.fromTabID(tabId)
tab.reload()
const tab = webContentsCache.getWebContents(tabId)
if (tab && !tab.isDestroyed()) {
tab.reload(true)
}
})
}

Expand Down
7 changes: 6 additions & 1 deletion app/renderer/components/frame/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,12 @@ class Frame extends React.Component {
}
break
case 'clean-reload':
tabActions.reload(this.props.tabId, true)
if (frameStateUtil.isTor(this.frame)) {
// Set a new Tor circuit
appActions.setTorNewIdentity(this.props.tabId, this.props.location)
} else {
tabActions.reload(this.props.tabId, true)
}
break
case 'zoom-in':
this.zoomIn()
Expand Down

0 comments on commit d43a263

Please sign in to comment.