diff --git a/app/browser/menu.js b/app/browser/menu.js index cf456a27e0c..ae26d3ece25 100644 --- a/app/browser/menu.js +++ b/app/browser/menu.js @@ -52,6 +52,7 @@ const createFileSubmenu = () => { const submenu = [ CommonMenu.newTabMenuItem(), CommonMenu.newPrivateTabMenuItem(), + CommonMenu.newTorTabMenuItem(), CommonMenu.newPartitionedTabMenuItem(), CommonMenu.newWindowMenuItem(), CommonMenu.separatorMenuItem, diff --git a/app/browser/reducers/aboutNewTabReducer.js b/app/browser/reducers/aboutNewTabReducer.js index 3290d04cf32..fa5fa549881 100644 --- a/app/browser/reducers/aboutNewTabReducer.js +++ b/app/browser/reducers/aboutNewTabReducer.js @@ -14,11 +14,9 @@ const aboutNewTabReducer = (state, action) => { switch (action.actionType) { case appConstants.APP_SET_STATE: const useAlternativePrivateSearchEngine = getSetting(settings.USE_ALTERNATIVE_PRIVATE_SEARCH_ENGINE, state.get('settings')) - const torEnabled = getSetting(settings.USE_TOR_PRIVATE_TABS) state = aboutNewTabState.mergeDetails(state, { newTabPageDetail: { - useAlternativePrivateSearchEngine, - torEnabled + useAlternativePrivateSearchEngine } }) break @@ -38,12 +36,6 @@ const aboutNewTabReducer = (state, action) => { useAlternativePrivateSearchEngine: action.value } }) - } else if (action.key === settings.USE_TOR_PRIVATE_TABS) { - state = aboutNewTabState.mergeDetails(state, { - newTabPageDetail: { - torEnabled: action.value - } - }) } } return state diff --git a/app/browser/tabs.js b/app/browser/tabs.js index dbc131b693d..4ced028fa5b 100644 --- a/app/browser/tabs.js +++ b/app/browser/tabs.js @@ -11,7 +11,7 @@ const {app, extensions, session, ipcMain} = require('electron') const {makeImmutable, makeJS} = require('../common/state/immutableUtil') const {getExtensionsPath, getTargetAboutUrl, getSourceAboutUrl, isSourceAboutUrl, newFrameUrl, isTargetAboutUrl, isIntermediateAboutPage, isTargetMagnetUrl, getSourceMagnetUrl} = require('../../js/lib/appUrlUtil') const {isURL, getUrlFromInput, toPDFJSLocation, getDefaultFaviconUrl, isHttpOrHttps, getLocationIfPDF} = require('../../js/lib/urlutil') -const {isSessionPartition} = require('../../js/state/frameStateUtil') +const {isSessionPartition, isTor} = require('../../js/state/frameStateUtil') const {getOrigin} = require('../../js/lib/urlutil') const settingsStore = require('../../js/settings') const settings = require('../../js/constants/settings') @@ -346,12 +346,14 @@ const updateAboutDetails = (tabId) => { const trackedBlockersCount = appState.getIn(['trackingProtection', 'count'], 0) const httpsUpgradedCount = appState.getIn(['httpsEverywhere', 'count'], 0) const adblockCount = appState.getIn(['adblock', 'count'], 0) + const torEnabled = isTor(getTabValue(tabId)) sendAboutDetails(tabId, messages.NEWTAB_DATA_UPDATED, { showEmptyPage, showImages, trackedBlockersCount, adblockCount, httpsUpgradedCount, + torEnabled, newTabDetail: newTabDetail.toJS() }) } else if (location === 'about:autofill') { @@ -522,7 +524,7 @@ const api = { if (ses) { isPrivate = ses.isOffTheRecord() } - const isTor = isPrivate && settingsStore.getSetting(settings.USE_TOR_PRIVATE_TABS) + const isTor = newTab.session.partition === appConfig.tor.partition const frameOpts = { location, diff --git a/app/browser/windows.js b/app/browser/windows.js index 3e09f9b68fc..8080039a3ee 100644 --- a/app/browser/windows.js +++ b/app/browser/windows.js @@ -211,12 +211,12 @@ function openFramesInWindow (win, frames, activeFrameKey) { let frameIndex = -1 for (const frame of frames) { frameIndex++ + const tab = webContentsCache.getWebContents(frame.tabId) if (frame.tabId != null && frame.guestInstanceId != null) { if (shouldDebugTabEvents) { console.log('notifyWindowWebContentsAdded: on window create with existing tab', win.id) } api.notifyWindowWebContentsAdded(win.id, frame) - const tab = webContentsCache.getWebContents(frame.tabId) if (tab && !tab.isDestroyed()) { tab.moveTo(frameIndex, win.id) } @@ -226,7 +226,7 @@ function openFramesInWindow (win, frames, activeFrameKey) { url: frame.location || frame.src || frame.provisionalLocation || frame.url, partitionNumber: frame.partitionNumber, isPrivate: frame.isPrivate, - isTor: frame.isPrivate && getSetting(settings.USE_TOR_PRIVATE_TABS), + isTor: tab && tab.session && tab.session.partition === appConfig.tor.partition, active: activeFrameKey ? frame.key === activeFrameKey : true, discarded: frame.unloaded, title: frame.title, diff --git a/app/common/commonMenu.js b/app/common/commonMenu.js index 5ad784bf957..d7f7a90e570 100644 --- a/app/common/commonMenu.js +++ b/app/common/commonMenu.js @@ -77,20 +77,23 @@ module.exports.newPrivateTabMenuItem = () => { label: locale.translation('newPrivateTab'), accelerator: 'Shift+CmdOrCtrl+P', click: function (item, focusedWindow) { - // Check if Tor is available - const useTor = getSetting(settings.USE_TOR_PRIVATE_TABS) - if (useTor) { - ensureAtLeastOneWindow({ - url: 'about:newtab', - isPrivate: true, - isTor: true - }) - } else { - ensureAtLeastOneWindow({ - url: 'about:newtab', - isPrivate: true - }) - } + ensureAtLeastOneWindow({ + url: 'about:newtab', + isPrivate: true + }) + } + } +} + +module.exports.newTorTabMenuItem = () => { + return { + label: locale.translation('newTorTab'), + click: function (item, focusedWindow) { + ensureAtLeastOneWindow({ + url: 'about:newtab', + isPrivate: true, + isTor: true + }) } } } diff --git a/app/extensions/brave/locales/en-US/menu.properties b/app/extensions/brave/locales/en-US/menu.properties index c8c29775870..d2e3e58a14f 100644 --- a/app/extensions/brave/locales/en-US/menu.properties +++ b/app/extensions/brave/locales/en-US/menu.properties @@ -99,6 +99,7 @@ muteTab=Mute Tab muteTabs=Mute Tabs new=New newPrivateTab=New Private Tab +newTorTab=New Private Tab with Tor newSessionTab=New Session Tab newTab=New Tab newWindow=New Window @@ -108,6 +109,8 @@ openFlashPreferences=Enable Flash in Preferences… openImageInNewTab=Open Image in New Tab openInNewPrivateTab=Open Link in New Private Tab openInNewPrivateTabs=Open Links in New Private Tabs +openInNewTorTab=Open Link in New Private Tab with Tor +openInNewTorTabs=Open Links in New Private Tabs with Tor openInNewSessionTab=Open Link in New Session Tab openInNewSessionTabs=Open Links in New Session Tabs openInNewTab=Open Link in New Tab diff --git a/app/locale.js b/app/locale.js index c97c3991e59..f018e3818e6 100644 --- a/app/locale.js +++ b/app/locale.js @@ -46,6 +46,8 @@ var rendererIdentifiers = function () { 'openInNewSessionTabs', 'openInNewPrivateTab', 'openInNewPrivateTabs', + 'openInNewTorTab', + 'openInNewTorTabs', 'openInNewTab', 'openInNewTabs', 'openAllInTabs', @@ -153,6 +155,7 @@ var rendererIdentifiers = function () { 'hideOthers', 'showAll', 'newPrivateTab', + 'newTorTab', 'newSessionTab', 'newWindow', 'reopenLastClosedTab', diff --git a/app/renderer/components/main/siteInfo.js b/app/renderer/components/main/siteInfo.js index 8fd8264fbf6..68d4643d7cd 100644 --- a/app/renderer/components/main/siteInfo.js +++ b/app/renderer/components/main/siteInfo.js @@ -30,9 +30,6 @@ const urlUtil = require('../../../../js/lib/urlutil') const globalStyles = require('../styles/global') const commonStyles = require('../styles/commonStyles') -// Constants -const settings = require('../../../../js/constants/settings') - class SiteInfo extends React.Component { constructor (props) { super(props) @@ -66,7 +63,6 @@ class SiteInfo extends React.Component { } onDisableTor () { - appActions.changeSetting(settings.USE_TOR_PRIVATE_TABS, false) appActions.recreateTorTab(false, this.props.activeTabId, this.props.activeTabIndex) } diff --git a/app/renderer/reducers/contextMenuReducer.js b/app/renderer/reducers/contextMenuReducer.js index 72ecbedad33..029523a8280 100644 --- a/app/renderer/reducers/contextMenuReducer.js +++ b/app/renderer/reducers/contextMenuReducer.js @@ -109,9 +109,8 @@ const onTabPageMenu = function (state, action) { tabPageMenu.popup(getCurrentWindow()) } -const openInNewTabMenuItem = (url, isPrivate, partitionNumber, openerTabId) => { +const openInNewTabMenuItem = (url, partitionNumber, openerTabId) => { const active = getSetting(settings.SWITCH_TO_NEW_TABS) === true - const isTor = isPrivate && getSetting(settings.USE_TOR_PRIVATE_TABS) if (Array.isArray(url) && Array.isArray(partitionNumber)) { return { label: locale.translation('openInNewTabs'), @@ -119,8 +118,6 @@ const openInNewTabMenuItem = (url, isPrivate, partitionNumber, openerTabId) => { for (let i = 0; i < url.length; ++i) { appActions.createTabRequested({ url: url[i], - isPrivate, - isTor, partitionNumber: partitionNumber[i], openerTabId, active @@ -134,8 +131,6 @@ const openInNewTabMenuItem = (url, isPrivate, partitionNumber, openerTabId) => { click: () => { appActions.createTabRequested({ url, - isPrivate, - isTor, partitionNumber, openerTabId, active @@ -145,12 +140,11 @@ const openInNewTabMenuItem = (url, isPrivate, partitionNumber, openerTabId) => { } } -const openInNewPrivateTabMenuItem = (url, openerTabId) => { +const openInNewPrivateTabMenuItem = (url, openerTabId, isTor) => { const active = getSetting(settings.SWITCH_TO_NEW_TABS) === true - const isTor = getSetting(settings.USE_TOR_PRIVATE_TABS) if (Array.isArray(url)) { return { - label: locale.translation('openInNewPrivateTabs'), + label: locale.translation(isTor ? 'openInNewTorTabs' : 'openInNewPrivateTabs'), click: () => { for (let i = 0; i < url.length; ++i) { appActions.createTabRequested({ @@ -165,7 +159,7 @@ const openInNewPrivateTabMenuItem = (url, openerTabId) => { } } else { return { - label: locale.translation('openInNewPrivateTab'), + label: locale.translation(isTor ? 'openInNewTorTab' : 'openInNewPrivateTab'), click: () => { appActions.createTabRequested({ url, @@ -210,12 +204,11 @@ const openInNewSessionTabMenuItem = (url, openerTabId) => { } } -const openInNewWindowMenuItem = (location, isPrivate, partitionNumber) => { - const isTor = isPrivate && getSetting(settings.USE_TOR_PRIVATE_TABS) +const openInNewWindowMenuItem = (location, partitionNumber) => { return { label: locale.translation('openInNewWindow'), click: () => { - appActions.newWindow({ location, isPrivate, isTor, partitionNumber }) + appActions.newWindow({ location, partitionNumber }) } } } @@ -321,9 +314,10 @@ const siteDetailTemplateInit = (state, siteKey, type) => { const location = siteDetail.get('location') template.push( - openInNewTabMenuItem(location, undefined, siteDetail.get('partitionNumber')), + openInNewTabMenuItem(location, siteDetail.get('partitionNumber')), openInNewPrivateTabMenuItem(location), - openInNewWindowMenuItem(location, undefined, siteDetail.get('partitionNumber')), + openInNewPrivateTabMenuItem(location, undefined, true), + openInNewWindowMenuItem(location, siteDetail.get('partitionNumber')), openInNewSessionTabMenuItem(location), copyAddressMenuItem('copyLinkAddress', location), CommonMenu.separatorMenuItem diff --git a/app/renderer/rendererShortcutHandler.js b/app/renderer/rendererShortcutHandler.js index 280c5904657..462d1d99233 100644 --- a/app/renderer/rendererShortcutHandler.js +++ b/app/renderer/rendererShortcutHandler.js @@ -120,7 +120,7 @@ function handleShortcut (frameKey, shortcut, e, args) { appActions.createTabRequested({ url: sourceLocation, isPrivate, - isTor: isPrivate && getSetting(settings.USE_TOR_PRIVATE_TABS), + isTor: frameStateUtil.isTor(frame), partitionNumber: frame.get('partitionNumber'), openerTabId: tabId, active: true diff --git a/docs/state.md b/docs/state.md index f5526cbda13..5eef6ab04f0 100644 --- a/docs/state.md +++ b/docs/state.md @@ -34,7 +34,6 @@ AppStore pinnedTopSites: [string], // list of pinned sites to be used on gridLayout. Defaults to 1 Brave-related site; see data/newTabData.js => pinnedTopSites sites: [string], // list of sites to be used on gridLayout. Defaults to 6 Brave-related sites; see data/newTabData.js => topSites updatedStamp: number, // timestamp for when the data was last updated - torEnabled: boolean, // whether Tor private tabs is enabled }, preferences: { backupNotifyCount: number, // number of times user has been reminded to backup wallet diff --git a/js/about/newprivatetab.js b/js/about/newprivatetab.js index a017b6efd85..c979022131d 100644 --- a/js/about/newprivatetab.js +++ b/js/about/newprivatetab.js @@ -19,15 +19,9 @@ const aboutActions = require('./aboutActions') require('../../less/about/newtab.less') const useAlternativePrivateSearchEngineDataKeys = ['newTabDetail', 'useAlternativePrivateSearchEngine'] -const torEnabled = ['newTabDetail', 'torEnabled'] const torFAQ = 'https://github.com/brave/browser-laptop/wiki/Using-Tor-in-Brave#faq' const onChangeTor = (value) => { - aboutActions.changeSetting(settings.USE_TOR_PRIVATE_TABS, value) - if (value === true) { - // Also change DDG to enabled since Google is unusable with Tor. - aboutActions.changeSetting(settings.USE_ALTERNATIVE_PRIVATE_SEARCH_ENGINE, value) - } aboutActions.recreateTorTab(value) } @@ -46,7 +40,7 @@ class NewPrivateTab extends React.Component { } onClickTorTitle () { - const newSettingValue = !this.props.newTabData.getIn(torEnabled) + const newSettingValue = !this.props.torEnabled onChangeTor(newSettingValue) } @@ -54,7 +48,7 @@ class NewPrivateTab extends React.Component { if (!this.props.newTabData) { return null } - const isTor = Boolean(this.props.newTabData.getIn(torEnabled)) + const isTor = Boolean(this.props.torEnabled) return
diff --git a/js/about/newtab.js b/js/about/newtab.js index 8f549e40f19..ce0ae2a1855 100644 --- a/js/about/newtab.js +++ b/js/about/newtab.js @@ -48,6 +48,7 @@ class NewTabPage extends React.Component { updatedStamp: undefined, showEmptyPage: true, showImages: false, + torEnabled: false, backgroundImage: undefined } @@ -68,6 +69,7 @@ class NewTabPage extends React.Component { newTabData: data, updatedStamp, showEmptyPage, + torEnabled: data.get('torEnabled'), showImages: !!data.get('showImages') && !showEmptyPage, backgroundImage: showImages ? this.state.backgroundImage || this.randomBackgroundImage @@ -263,7 +265,7 @@ class NewTabPage extends React.Component { // TODO: use this.props.isIncognito when muon supports it for tor tabs if (this.props.isIncognito) { - return + return } // don't render until object is found diff --git a/js/constants/appConfig.js b/js/constants/appConfig.js index b76e10f481b..309790de9ce 100644 --- a/js/constants/appConfig.js +++ b/js/constants/appConfig.js @@ -151,7 +151,7 @@ module.exports = { 'general.spellcheck-languages': Immutable.fromJS(['en-US']), 'search.default-search-engine': 'Google', 'search.offer-search-suggestions': false, // false by default for privacy reasons - 'search.use-alternate-private-search-engine': false, + 'search.use-alternate-private-search-engine': true, 'tabs.switch-to-new-tabs': false, 'tabs.paint-tabs': true, 'tabs.tabs-per-page': 20, @@ -174,7 +174,6 @@ module.exports = { 'security.autoplay.media': autoplayOption.ALWAYS_ALLOW, 'security.flash.installed': false, 'security.site-isolation-enabled': false, - 'tor.private-tabs.enabled': false, 'shields.blocked-count-badge': true, 'shields.compact-bravery-panel': false, // sync diff --git a/js/constants/settings.js b/js/constants/settings.js index 4e9a92535f2..6b37f57b5d6 100644 --- a/js/constants/settings.js +++ b/js/constants/settings.js @@ -102,8 +102,6 @@ const settings = { // Debug settings DEBUG_ALLOW_MANUAL_TAB_DISCARD: 'debug.manual-tab-discard.enabled', DEBUG_VERBOSE_TAB_INFO: 'debug.verbose-tab-info.enabled', - // Tor settings - USE_TOR_PRIVATE_TABS: 'tor.private-tabs.enabled', // DEPRECATED settings // DO NOT REMOVE OR CHANGE THESE VALUES diff --git a/js/contextMenus.js b/js/contextMenus.js index 751048fb83f..9f3b101ab73 100644 --- a/js/contextMenus.js +++ b/js/contextMenus.js @@ -263,8 +263,9 @@ const siteMultipleDetailTemplate = (data, type, activeFrame) => { }) template.push( - openInNewTabMenuItem(locations, undefined, partitionNumbers), + openInNewTabMenuItem(locations, partitionNumbers), openInNewPrivateTabMenuItem(locations), + openInNewPrivateTabMenuItem(locations, undefined, true), openInNewSessionTabMenuItem(locations), CommonMenu.separatorMenuItem ) @@ -313,8 +314,9 @@ const siteSingleDetailTemplate = (siteKey, type, activeFrame) => { const location = siteDetail.get('location') template.push( - openInNewTabMenuItem(location, undefined, siteDetail.get('partitionNumber')), + openInNewTabMenuItem(location, siteDetail.get('partitionNumber')), openInNewPrivateTabMenuItem(location), + openInNewPrivateTabMenuItem(location, undefined, true), openInNewWindowMenuItem(location, undefined, siteDetail.get('partitionNumber')), openInNewSessionTabMenuItem(location), copyAddressMenuItem('copyLinkAddress', location), @@ -678,6 +680,7 @@ function hamburgerTemplateInit (location, e) { const template = [ CommonMenu.newTabMenuItem(), CommonMenu.newPrivateTabMenuItem(), + CommonMenu.newTorTabMenuItem(), CommonMenu.newPartitionedTabMenuItem(), CommonMenu.newWindowMenuItem(), CommonMenu.separatorMenuItem, @@ -734,8 +737,7 @@ function hamburgerTemplateInit (location, e) { return menuUtil.sanitizeTemplateItems(template) } -const openInNewTabMenuItem = (url, isPrivate, partitionNumber, openerTabId) => { - const isTor = isPrivate && getSetting(settings.USE_TOR_PRIVATE_TABS) +const openInNewTabMenuItem = (url, partitionNumber, openerTabId) => { const active = getSetting(settings.SWITCH_TO_NEW_TABS) === true if (Array.isArray(url) && Array.isArray(partitionNumber)) { return { @@ -744,8 +746,6 @@ const openInNewTabMenuItem = (url, isPrivate, partitionNumber, openerTabId) => { for (let i = 0; i < url.length; ++i) { appActions.createTabRequested({ url: url[i], - isPrivate, - isTor, partitionNumber: partitionNumber[i], openerTabId, active @@ -759,8 +759,6 @@ const openInNewTabMenuItem = (url, isPrivate, partitionNumber, openerTabId) => { click: () => { appActions.createTabRequested({ url, - isPrivate, - isTor, partitionNumber, openerTabId, active @@ -779,12 +777,11 @@ const openAllInNewTabsMenuItem = (folderDetail) => { } } -const openInNewPrivateTabMenuItem = (url, openerTabId) => { +const openInNewPrivateTabMenuItem = (url, openerTabId, isTor) => { const active = getSetting(settings.SWITCH_TO_NEW_TABS) === true - const isTor = getSetting(settings.USE_TOR_PRIVATE_TABS) if (Array.isArray(url)) { return { - label: locale.translation('openInNewPrivateTabs'), + label: locale.translation(isTor ? 'openInNewTorTabs' : 'openInNewPrivateTabs'), click: () => { for (let i = 0; i < url.length; ++i) { appActions.createTabRequested({ @@ -799,7 +796,7 @@ const openInNewPrivateTabMenuItem = (url, openerTabId) => { } } else { return { - label: locale.translation('openInNewPrivateTab'), + label: locale.translation(isTor ? 'openInNewTorTab' : 'openInNewPrivateTab'), click: () => { appActions.createTabRequested({ url, @@ -813,8 +810,7 @@ const openInNewPrivateTabMenuItem = (url, openerTabId) => { } } -const openInNewWindowMenuItem = (location, isPrivate, partitionNumber) => { - const isTor = isPrivate && getSetting(settings.USE_TOR_PRIVATE_TABS) +const openInNewWindowMenuItem = (location, isPrivate, partitionNumber, isTor) => { return { label: locale.translation('openInNewWindow'), click: () => { @@ -895,7 +891,7 @@ const searchSelectionMenuItem = (location) => { let frame = windowStore.getFrame(activeFrame) let searchUrl = appStoreRenderer.state.getIn(['searchDetail', 'searchURL']).replace('{searchTerms}', encodeURIComponent(location)) const isPrivate = frame.get('isPrivate') - const isTor = isPrivate && getSetting(settings.USE_TOR_PRIVATE_TABS) + const isTor = frameStateUtil.isTor(frame) appActions.createTabRequested({ url: searchUrl, isPrivate, @@ -930,10 +926,12 @@ const addToPublisherListMenuItem = (location) => { function addLinkMenu (link, frame) { const template = [] if (!frame.get('isPrivate')) { - template.push(openInNewTabMenuItem(link, frame.get('isPrivate'), frame.get('partitionNumber'), frame.get('tabId'))) + template.push(openInNewTabMenuItem(link, frame.get('partitionNumber'), frame.get('tabId'))) } + const isTor = frameStateUtil.isTor(frame) template.push( - openInNewPrivateTabMenuItem(link, frame.get('tabId')), + openInNewPrivateTabMenuItem(link, frame.get('tabId'), isTor), + openInNewPrivateTabMenuItem(link, frame.get('tabId'), !isTor), openInNewWindowMenuItem(link, frame.get('isPrivate'), frame.get('partitionNumber')), CommonMenu.separatorMenuItem, openInNewSessionTabMenuItem(link, frame.get('tabId')), @@ -965,7 +963,7 @@ function mainTemplateInit (nodeProps, frame, tab) { const isTextSelected = nodeProps.selectionText && nodeProps.selectionText.length > 0 const isAboutPage = aboutUrls.has(frame.get('location')) const isPrivate = frame.get('isPrivate') - const isTor = isPrivate && getSetting(settings.USE_TOR_PRIVATE_TABS) + const isTor = isPrivate && frameStateUtil.isTor(frame) if (isLink) { template = addLinkMenu(nodeProps.linkURL, frame) @@ -1329,6 +1327,7 @@ function onNewTabContextMenu (target) { const menuTemplate = [ CommonMenu.newTabMenuItem(), CommonMenu.newPrivateTabMenuItem(), + CommonMenu.newTorTabMenuItem(), CommonMenu.newPartitionedTabMenuItem(), CommonMenu.newWindowMenuItem() ] @@ -1376,6 +1375,7 @@ function onSiteDetailContextMenu (data, type, activeFrame, e) { function onLedgerContextMenu (location, hostPattern) { const template = [openInNewTabMenuItem(location), openInNewPrivateTabMenuItem(location), + openInNewPrivateTabMenuItem(location, undefined, true), openInNewSessionTabMenuItem(location), copyAddressMenuItem('copyLinkAddress', location), CommonMenu.separatorMenuItem, diff --git a/js/flash.js b/js/flash.js index e98932a25ef..5669441074b 100644 --- a/js/flash.js +++ b/js/flash.js @@ -11,6 +11,7 @@ const {getOrigin} = require('./lib/urlutil') const locale = require('../app/locale') const messages = require('./constants/messages') const settings = require('./constants/settings') +const appConfig = require('./constants/appConfig') const {getSetting} = require('./settings') const {memoize} = require('underscore') const tabState = require('../app/common/state/tabState') @@ -163,7 +164,7 @@ module.exports.onFlashContextMenu = (state, tabId) => { if (!tab) { return } - if (tabState.isIncognito(state, tabId) && getSetting(settings.USE_TOR_PRIVATE_TABS)) { + if (tab.session && tab.session.partition === appConfig.tor.partition) { return }