<p dir="auto">Hello, when creating a browser window like this:<br>
<code class="notranslate">new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, webSecurity: false, partition: '', session: session.fromPartition(</code>${counter}<code class="notranslate">) }</code><br>
and using a session:<br>
<code class="notranslate">protocol.interceptBufferProtocol('http', (req, callback) =&gt; { console.log('Hello World'); });</code><br>
Is never called</p>
<p dir="auto">Brief: When a session is set when creating a BrowserWindow, the protocol intercept functions are not activated.</p>
<p dir="auto">Electron version: 6.0.8<br>
Operating system: (Bug happens on Mac, Win 7, Win 10 and Ubuntu, so it's not an OS issue)</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">When the user navigates to a http page, the <code class="notranslate">protocol.interceptBufferProtocol</code> callback function should be called,<br>
in this case, "Hello World" should be printed to the console</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">The <code class="notranslate">protocol.interceptBufferProtocol</code> callback function is not called/ran at all. In this case, nothing is printed in the console</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">Create a BrowserWindow and define <code class="notranslate">session</code> in the webPreferences</p>
<p dir="auto"><code class="notranslate">protocol.interceptBufferProtocol('http', (req, callback) =&gt; { console.log('Hello World'); });</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="new BrowserWindow({
        show: false,
        webPreferences: {
            nodeIntegration: true,
            webSecurity: false,
            partition: '',
            session: session.fromPartition(`1`)
        }"><pre class="notranslate"><code class="notranslate">new BrowserWindow({
        show: false,
        webPreferences: {
            nodeIntegration: true,
            webSecurity: false,
            partition: '',
            session: session.fromPartition(`1`)
        }
</code></pre></div>