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

Commit

Permalink
disable extension context menus in private tabs
Browse files Browse the repository at this point in the history
fix #8180

Test Plan:
1. enable lastpass
2. right-click on a page in a regular tab. you should see the lastpass context menu.
3. right-click on a page in a private tab. you should not see the lastpass context menu.
  • Loading branch information
diracdeltas committed Apr 17, 2017
1 parent 27a9e79 commit 26ae270
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 @@ -997,6 +997,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 @@ -1013,7 +1014,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 @@ -1047,7 +1048,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 @@ -1199,8 +1200,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 26ae270

Please sign in to comment.