<p dir="auto"><strong>Is your feature request related to a problem? Please describe.</strong></p>
<p dir="auto">It's currently very inconvenient to create (dynamic) MenuItem's that change based on some condition. Most apps need this, but it requires recreating and replacing the whole menu.</p>
<p dir="auto"><strong>Describe the solution you'd like</strong></p>
<p dir="auto">If <code class="notranslate">MenuItem</code> accepted a function that returns the options, and called that function before showing the menu, it would solve most problems with creating dynamic <code class="notranslate">MenuItem</code>'s.</p>
<p dir="auto">Example:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="new MenuItem(() =&gt; ({
	label: 'Foo',
	checked: someCondition === true
}));"><pre class="notranslate"><span class="pl-k">new</span> <span class="pl-v">MenuItem</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span><span class="pl-kos">{</span>
	<span class="pl-c1">label</span>: <span class="pl-s">'Foo'</span><span class="pl-kos">,</span>
	<span class="pl-c1">checked</span>: <span class="pl-s1">someCondition</span> <span class="pl-c1">===</span> <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Describe alternatives you've considered</strong></p>
<p dir="auto">This could be narrowed to just the <code class="notranslate">label</code>, <code class="notranslate">checked</code>, <code class="notranslate">enabled</code>, <code class="notranslate">visible</code> options, as that would cover most use-cases.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="new MenuItem({
	label: 'Foo',
	checked: () =&gt; someCondition === true
});"><pre class="notranslate"><span class="pl-k">new</span> <span class="pl-v">MenuItem</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
	<span class="pl-c1">label</span>: <span class="pl-s">'Foo'</span><span class="pl-kos">,</span>
	<span class="pl-en">checked</span>: <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">someCondition</span> <span class="pl-c1">===</span> <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Additional context</strong></p>
<p dir="auto">This is a slight duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="38971425" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/528" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/528/hovercard" href="https://github.com/electron/electron/issues/528">#528</a>, but that issue has gone unanswered for years and doesn't seem to be going anywhere. This issue includes a concrete proposal to solve the main use-cases.</p>
<p dir="auto">Can I use the chrome kernel of the local browser? Otherwise, exe volumes are always large after compilation.</p>