<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/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" checked=""> 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 class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> 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>
<ul dir="auto">
<li>
 11.3.0
</li>
</ul>
</li>
<li><strong>Operating System:</strong>
<ul dir="auto">
<li>
 Windows 10 Pro (20H2)
</li>
</ul>
</li>
<li><strong>Last Known Working Electron version:</strong>
<ul dir="auto">
<li>

</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>

<p dir="auto">I would like to make a default callback if I don't want to modify the request</p>
<h3 dir="auto">Actual Behavior</h3>

<p dir="auto">I can create a callback of my own, but there is no way to return the default callback or let it follow normal rhythm without modifying</p>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto">Fiddle: <a href="https://gist.github.com/19c24511024997d2415c2df3f5eabe2e">https://gist.github.com/19c24511024997d2415c2df3f5eabe2e</a></p>
<ul dir="auto">
<li>Electron version: 1.3.6 (win32-ia32 zip)</li>
<li>Operating system: Windows 10.0.14393 Build 14393</li>
</ul>
<p dir="auto">Create a <code class="notranslate">main.js</code> file that loads a wikipedia page:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var electron = require('electron')
var app = electron.app
var BrowserWindow = electron.BrowserWindow

var mainWindow;

function createWindow () {
    mainWindow = new BrowserWindow({width: 800, height: 600})
    mainWindow.loadURL(`https://en.wikipedia.org/wiki/Timi%C8%99oara`)
    mainWindow.webContents.openDevTools()
    mainWindow.on('closed', function () {
        mainWindow = null
    })
}

app.on('ready', createWindow)

app.on('window-all-closed', function () {
    if (process.platform !== 'darwin') {
        app.quit()
    }
})

app.on('activate', function () {
    if (mainWindow === null) {
        createWindow()
    }
})
"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">electron</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-k">var</span> <span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-s1">electron</span><span class="pl-kos">.</span><span class="pl-c1">app</span>
<span class="pl-k">var</span> <span class="pl-v">BrowserWindow</span> <span class="pl-c1">=</span> <span class="pl-s1">electron</span><span class="pl-kos">.</span><span class="pl-c1">BrowserWindow</span>

<span class="pl-k">var</span> <span class="pl-s1">mainWindow</span><span class="pl-kos">;</span>

<span class="pl-k">function</span> <span class="pl-en">createWindow</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-s1">mainWindow</span> <span class="pl-c1">=</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">width</span>: <span class="pl-c1">800</span><span class="pl-kos">,</span> <span class="pl-c1">height</span>: <span class="pl-c1">600</span><span class="pl-kos">}</span><span class="pl-kos">)</span>
    <span class="pl-s1">mainWindow</span><span class="pl-kos">.</span><span class="pl-en">loadURL</span><span class="pl-kos">(</span><span class="pl-s">`https://en.wikipedia.org/wiki/Timi%C8%99oara`</span><span class="pl-kos">)</span>
    <span class="pl-s1">mainWindow</span><span class="pl-kos">.</span><span class="pl-c1">webContents</span><span class="pl-kos">.</span><span class="pl-en">openDevTools</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
    <span class="pl-s1">mainWindow</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'closed'</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">mainWindow</span> <span class="pl-c1">=</span> <span class="pl-c1">null</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>

<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'ready'</span><span class="pl-kos">,</span> <span class="pl-s1">createWindow</span><span class="pl-kos">)</span>

<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'window-all-closed'</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">platform</span> <span class="pl-c1">!==</span> <span class="pl-s">'darwin'</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">quit</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>

<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'activate'</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">mainWindow</span> <span class="pl-c1">===</span> <span class="pl-c1">null</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-en">createWindow</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<ul dir="auto">
<li>run <code class="notranslate">electron.exe main.js</code></li>
<li>scroll up and down rapidly by dragging the scrollbar</li>
<li>watch CPU usage or Record with the Timeline</li>
<li><strong>renderer process goes to 100% CPU usage</strong></li>
<li>main process stays at 1-2% CPU usage</li>
<li>both Chromium on a version before and Chrome on a version after do not have this problem.</li>
</ul>
<h2 dir="auto">Electron v1.3.6 (process.versions.chrome = 52.0.2743.82)</h2>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/5047891/18516379/fb00b350-7a98-11e6-840c-8303857e276c.png"><img src="https://cloud.githubusercontent.com/assets/5047891/18516379/fb00b350-7a98-11e6-840c-8303857e276c.png" alt="image" style="max-width: 100%;"></a></p>
<h2 dir="auto">Chromium version 52.0.2743.0</h2>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/5047891/18516434/4749037a-7a99-11e6-9ce7-74ae68ee55fc.png"><img src="https://cloud.githubusercontent.com/assets/5047891/18516434/4749037a-7a99-11e6-9ce7-74ae68ee55fc.png" alt="image" style="max-width: 100%;"></a></p>
<h2 dir="auto">Chrome version 53.0.2785.113 m (64-bit)</h2>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/5047891/18516666/22c69886-7a9a-11e6-9146-8f2996e80c00.png"><img src="https://cloud.githubusercontent.com/assets/5047891/18516666/22c69886-7a9a-11e6-9146-8f2996e80c00.png" alt="image" style="max-width: 100%;"></a></p>
<h2 dir="auto">Electron version 0.37.6 (process.versions.chrome = 49.0.2623.75)</h2>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/5047891/18516934/08ed6e3e-7a9b-11e6-9446-efdb8b8dfbb6.png"><img src="https://cloud.githubusercontent.com/assets/5047891/18516934/08ed6e3e-7a9b-11e6-9446-efdb8b8dfbb6.png" alt="image" style="max-width: 100%;"></a></p>
<h2 dir="auto">More info:</h2>
<ul dir="auto">
<li><strong>Reproduces</strong> in Electron version 0.37.6</li>
<li>fyi <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bbondy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bbondy">@bbondy</a> Reproduces in Brave 0.12.0 (Electron 1.3.10, libchromiumcontent: 52.0.2743.116)</li>
<li>Reproduces on Surface Book, in external monitor at 100% zoom</li>
<li><strong>Does not</strong> reproduce on Lenovo w530 with the same Windows version</li>
<li>this impacts VSCode considerably (why I started looking into this)</li>
</ul>
<h2 dir="auto">Hints:</h2>
<ul dir="auto">
<li>The only hints I could find are when clicking on the input events and most of them in Electron appear to be waiting a long time on the main process. For Chromium 52 or Chrome 53, the total time of these events is never longer than 20-30ms, typically even shorter:</li>
</ul>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/5047891/18516749/65585ff4-7a9a-11e6-9077-0c0f2970341d.png"><img src="https://cloud.githubusercontent.com/assets/5047891/18516749/65585ff4-7a9a-11e6-9077-0c0f2970341d.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">fyi <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zcbenz/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zcbenz">@zcbenz</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kevinsawicki/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kevinsawicki">@kevinsawicki</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bpasero/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bpasero">@bpasero</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dbaeumer/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dbaeumer">@dbaeumer</a></p>