<p dir="auto">Hi all,</p>
<p dir="auto">In my Electron app, I capture navigation events from a webview in the main window and display the contents in a second window.</p>
<p dir="auto">Capturing the event and displaying the selected contents in the second window using <code class="notranslate">webview.addEventListener('will-navigate', ...)</code> and some renderer-&gt;main-&gt;renderer ipc works just fine, but I haven't been able to prevent the main window webview from also loading the linked page contents, despite calling <code class="notranslate">Event.preventDefault()</code> and <code class="notranslate">Event.stopPropagation()</code>. I'm aware of issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="128064720" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/4191" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/4191/hovercard" href="https://github.com/electron/electron/issues/4191">#4191</a> and others that have reported this before, but if there's a fix or a workaround for this problem, I haven't found one.</p>
<p dir="auto">The following complete code is supposed to ignore all navigation events and leave the original page in place, but instead it replaces it with the navigated page contents every time.</p>
<p dir="auto"><strong>app.js</strong>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const {app, BrowserWindow} = require('electron')
app.on('ready', () =&gt; {
    let win = new BrowserWindow({width: 800, height: 600})
    win.loadURL('file://' + __dirname + '/app.html')
    win.on('closed', () =&gt; app.quit())
})"><pre class="notranslate"><code class="notranslate">const {app, BrowserWindow} = require('electron')
app.on('ready', () =&gt; {
    let win = new BrowserWindow({width: 800, height: 600})
    win.loadURL('file://' + __dirname + '/app.html')
    win.on('closed', () =&gt; app.quit())
})
</code></pre></div>
<p dir="auto"><strong>app.html</strong>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Navigate&lt;/title&gt;
&lt;/head&gt;
&lt;style&gt;.view {width: 100vw; height: 100vh}&lt;/style&gt;
&lt;body style=&quot;margin: 0&quot;&gt;
    &lt;webview class=&quot;view&quot; id=&quot;view&quot; src=&quot;https://electronjs.org/docs/all&quot;&gt;&lt;/webview&gt;
&lt;/body&gt;
&lt;script&gt;
    const webview = document.getElementById('view')
    webview.addEventListener('will-navigate', event =&gt; {
        console.log('Preventing navigation to ' + event.url)
        event.preventDefault()
        event.stopPropagation()
    }, false)
&lt;/script&gt;
&lt;/html&gt;"><pre class="notranslate"><code class="notranslate">&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Navigate&lt;/title&gt;
&lt;/head&gt;
&lt;style&gt;.view {width: 100vw; height: 100vh}&lt;/style&gt;
&lt;body style="margin: 0"&gt;
    &lt;webview class="view" id="view" src="https://electronjs.org/docs/all"&gt;&lt;/webview&gt;
&lt;/body&gt;
&lt;script&gt;
    const webview = document.getElementById('view')
    webview.addEventListener('will-navigate', event =&gt; {
        console.log('Preventing navigation to ' + event.url)
        event.preventDefault()
        event.stopPropagation()
    }, false)
&lt;/script&gt;
&lt;/html&gt;
</code></pre></div>
<p dir="auto">Am I missing something?</p>
<p dir="auto">Environment:</p>
<ul dir="auto">
<li>Electron version: 1.8.2</li>
<li>Operating system: Windows 10</li>
</ul>
<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"> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li>[ x] I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong><br>
4.0.0. ,  5.0.0</li>
<li><strong>Operating System:</strong><br>
Windows 10 (1803)</li>
<li><strong>Last Known Working Electron version:</strong><br>
I did not find any working version</li>
</ul>
<p dir="auto">Repro steps:</p>
<ul dir="auto">
<li>open developer tools</li>
<li>go to Elements tab</li>
<li>select any html element</li>
<li>open Accessibility tab</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<ul dir="auto">
<li>accessibility tab show accessibility tree</li>
</ul>
<h3 dir="auto">Actual Behavior</h3>
<ul dir="auto">
<li>accesisbility tab is empty<br>
Error in console:<br>
<code class="notranslate">[99978:0610/175341.131749:ERROR:CONSOLE(24)] "Empty response arrived for script 'devtools://devtools/remote/serve_file/@f200986dfaabd6aad6a4b37dad7aae42fec349e9/accessibility/accessibility_module.js'", source: devtools://devtools/bundled/shell.js (24) [99978:0610/175341.140809:ERROR:CONSOLE(109)] "Uncaught (in promise) Error: Could not instantiate: Accessibility.AccessibilitySidebarView", source: devtools://devtools/bundled/shell.js (109)</code></li>
</ul>
<h3 dir="auto">Screenshots</h3>
<p dir="auto">Screenshot took from Electron Fiddle:</p>

<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/22620150/59215318-425b4880-8bb9-11e9-98bd-c002db5d3cd9.png"><img src="https://user-images.githubusercontent.com/22620150/59215318-425b4880-8bb9-11e9-98bd-c002db5d3cd9.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Additional Information</h3>