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

Commit

Permalink
Merge pull request #8363 from brave/fix/8180
Browse files Browse the repository at this point in the history
disable extension context menus in private tabs
  • Loading branch information
diracdeltas authored Apr 25, 2017
2 parents ad18376 + 26ae270 commit d4820ff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/contextMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,7 @@ function mainTemplateInit (nodeProps, frame, tab) {
const isInputField = nodeProps.isEditable || nodeProps.inputFieldType !== 'none'
const isTextSelected = nodeProps.selectionText && nodeProps.selectionText.length > 0
const isAboutPage = aboutUrls.has(frame.get('location'))
const isPrivate = frame.get('isPrivate')

if (isLink) {
template = addLinkMenu(nodeProps.linkURL, frame)
Expand All @@ -1034,7 +1035,7 @@ function mainTemplateInit (nodeProps, frame, tab) {
appActions.createTabRequested({
url: nodeProps.srcURL,
openerTabId: frame.get('tabId'),
partition: getPartitionFromNumber(frame.get('partitionNumber'), frame.get('isPrivate'))
partition: getPartitionFromNumber(frame.get('partitionNumber'), isPrivate)
})
}
}
Expand Down Expand Up @@ -1068,7 +1069,7 @@ function mainTemplateInit (nodeProps, frame, tab) {
.replace('?q', 'byimage?image_url')
appActions.createTabRequested({
url: searchUrl,
isPrivate: frame.get('isPrivate'),
isPrivate,
partitionNumber: frame.get('partitionNumber')
})
}
Expand Down Expand Up @@ -1220,8 +1221,9 @@ function mainTemplateInit (nodeProps, frame, tab) {
})
}

const extensionContextMenus =
extensionState.getContextMenusProperties(appStore.state)
const extensionContextMenus = isPrivate
? undefined
: extensionState.getContextMenusProperties(appStore.state)
if (extensionContextMenus !== undefined &&
extensionContextMenus.length) {
template.push(CommonMenu.separatorMenuItem)
Expand Down

0 comments on commit d4820ff

Please sign in to comment.