Skip to content

Commit

Permalink
Fix showing Inspect Element menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Nov 8, 2019
1 parent 4d28a12 commit 9e9fd9a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ const create = (win, options) => {
inspect: () => ({
id: 'inspect',
label: 'Inspect Element',
enabled: isDev,
click() {
win.inspectElement(props.x, props.y);

Expand All @@ -155,6 +154,8 @@ const create = (win, options) => {
})
};

const shouldShowInspectElement = typeof options.showInspectElement === 'boolean' ? options.showInspectElement : isDev;

let menuTemplate = [
defaultActions.separator(),
options.showLookUpSelection !== false && defaultActions.lookUpSelection(),
Expand All @@ -170,7 +171,7 @@ const create = (win, options) => {
defaultActions.separator(),
defaultActions.copyLink(),
defaultActions.separator(),
options.showInspectElement && defaultActions.inspect(),
shouldShowInspectElement && defaultActions.inspect(),
options.showServices && defaultActions.services(),
defaultActions.separator()
];
Expand Down

0 comments on commit 9e9fd9a

Please sign in to comment.