From 9e9fd9a771a060d352058d9d9e12340d172dc83a Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Sat, 9 Nov 2019 01:00:54 +0700 Subject: [PATCH] Fix showing `Inspect Element` menu item --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 72bc9f1..17096c6 100644 --- a/index.js +++ b/index.js @@ -138,7 +138,6 @@ const create = (win, options) => { inspect: () => ({ id: 'inspect', label: 'Inspect Element', - enabled: isDev, click() { win.inspectElement(props.x, props.y); @@ -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(), @@ -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() ];