<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/main/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Electron Version</h3>
<p dir="auto">15.1.0</p>
<h3 dir="auto">What operating system are you using?</h3>
<p dir="auto">Ubuntu</p>
<h3 dir="auto">Operating System Version</h3>
<p dir="auto">ubuntu 18.04</p>
<h3 dir="auto">What arch are you using?</h3>
<p dir="auto">x64</p>
<h3 dir="auto">Last Known Working Electron version</h3>
<p dir="auto">15.0.0</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">When invoking a context-menu event on the webcontents of a webview in the renderer process, the function works and does not give an error.</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">Since <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="987935764" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/30831" data-hovercard-type="pull_request" data-hovercard-url="/electron/electron/pull/30831/hovercard" href="https://github.com/electron/electron/pull/30831">#30831</a> <code class="notranslate">frame</code> is sent along with the params, but <code class="notranslate">frame</code> is not serializable so can not cross from the main process to the renderer process. This results in an error being shown to the user.</p>
<h3 dir="auto">Testcase Gist URL</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">I'm aware that getting the webContents in the renderer process (using @electron/remote) is an antipattern. Still, I feel this is something we should not break in a minor release.</p>
<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/main/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Electron Version</h3>
<p dir="auto">15.1.0 / and all 16.0.0-alpha.x</p>
<h3 dir="auto">What operating system are you using?</h3>
<p dir="auto">Other Linux</p>
<h3 dir="auto">Operating System Version</h3>
<p dir="auto">kernel 5.14.7-2</p>
<h3 dir="auto">What arch are you using?</h3>
<p dir="auto">x64</p>
<h3 dir="auto">Last Known Working Electron version</h3>
<p dir="auto">15.0.0</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">No error occurs.</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">The <code class="notranslate">Failed to serialize arguments</code> error occurs on right mouse click on the webview's content.</p>
<h3 dir="auto">Testcase Gist URL</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">Notice there is no error when you do the right mouse click on the browserwindow's content but on webview's.</p>
<p dir="auto">Notice that adding the "context-menu" handler is not even required.</p>
<p dir="auto">The "input" controls were  added to the snippet just for the convenience of testing. The right mouse click on any area of webview triggers the error.</p>
<p dir="auto">To reproduce:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const {app, BrowserWindow} = require(&quot;electron&quot;)

app.whenReady().then(() =&gt; {
  //  app.on(&quot;web-contents-created&quot;, (...[/* event */, webContents]) =&gt; {
  //    webContents.on(&quot;context-menu&quot;, () =&gt; {/* NOOP */})
  //  })
  new BrowserWindow({webPreferences: {webviewTag: true}}).loadURL(`data:text/html,
    &lt;html&gt;&lt;body&gt;
    &lt;input type='text' value='input'&gt;
    &lt;webview src=&quot;data:text/html,&lt;input type='text' value='webview input'&gt;&quot;&gt;&lt;/webview&gt;
    &lt;/body&gt;&lt;/html&gt;`,
  )
})"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-kos">{</span>app<span class="pl-kos">,</span> BrowserWindow<span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"electron"</span><span class="pl-kos">)</span>

<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">whenReady</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</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-c">//  app.on("web-contents-created", (...[/* event */, webContents]) =&gt; {</span>
  <span class="pl-c">//    webContents.on("context-menu", () =&gt; {/* NOOP */})</span>
  <span class="pl-c">//  })</span>
  <span class="pl-k">new</span> <span class="pl-v">BrowserWindow</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">webPreferences</span>: <span class="pl-kos">{</span><span class="pl-c1">webviewTag</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><span class="pl-en">loadURL</span><span class="pl-kos">(</span><span class="pl-s">`data:text/html,</span>
<span class="pl-s">    &lt;html&gt;&lt;body&gt;</span>
<span class="pl-s">    &lt;input type='text' value='input'&gt;</span>
<span class="pl-s">    &lt;webview src="data:text/html,&lt;input type='text' value='webview input'&gt;"&gt;&lt;/webview&gt;</span>
<span class="pl-s">    &lt;/body&gt;&lt;/html&gt;`</span><span class="pl-kos">,</span>
  <span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>