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 #3713 from Liunkae/patch-1
Browse files Browse the repository at this point in the history
Removed unneeded context menu items (Fix #3670)
  • Loading branch information
bbondy authored Sep 12, 2016
2 parents 77d3cbe + f25f306 commit 47bf893
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions js/contextMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,30 +410,32 @@ function autofillTemplateInit (suggestions, frame) {
function tabTemplateInit (frameProps) {
const frameKey = frameProps.get('key')
const items = []
items.push(
CommonMenu.newTabMenuItem(frameProps.get('key')),
CommonMenu.separatorMenuItem,
{
label: locale.translation('reloadTab'),
click: (item, focusedWindow) => {
if (focusedWindow) {
focusedWindow.webContents.send(messages.SHORTCUT_FRAME_RELOAD, frameKey)
const location = frameProps.get('location')
if (location !== 'about:newtab') {
items.push(
CommonMenu.newTabMenuItem(frameProps.get('key')),
CommonMenu.separatorMenuItem,
{
label: locale.translation('reloadTab'),
click: (item, focusedWindow) => {
if (focusedWindow) {
focusedWindow.webContents.send(messages.SHORTCUT_FRAME_RELOAD, frameKey)
}
}
}
}, {
label: locale.translation('clone'),
click: (item, focusedWindow) => {
if (focusedWindow) {
focusedWindow.webContents.send(messages.SHORTCUT_FRAME_CLONE, frameKey, {
openInForeground: true
})
}, {
label: locale.translation('clone'),
click: (item, focusedWindow) => {
if (focusedWindow) {
focusedWindow.webContents.send(messages.SHORTCUT_FRAME_CLONE, frameKey, {
openInForeground: true
})
}
}
}
})
})
}

if (!frameProps.get('isPrivate')) {
const isPinned = frameProps.get('pinnedLocation')
const location = frameProps.get('location')
if (!(location === 'about:blank' || location === 'about:newtab' || isIntermediateAboutPage(location))) {
items.push({
label: locale.translation(isPinned ? 'unpinTab' : 'pinTab'),
Expand Down

0 comments on commit 47bf893

Please sign in to comment.