<p dir="auto">I reported this bug on the 3.x series and it was never addressed.</p>
<p dir="auto">The community had a workaround by calling the callback via setTimeout.</p>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="337223491" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/13519" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/13519/hovercard" href="https://github.com/electron/electron/issues/13519">#13519</a></p>
<p dir="auto">... but now the workaround is dead in the 4.x.x series.</p>
<p dir="auto">The devs NEED to take this seriously.  This just killed my app and if it's not fixed I might as well shut down the entire project.</p>
<p dir="auto">I tried to refactor my code to call the callback without setTimeout and that doesn't fix the problem.</p>
<p dir="auto">Can someone from the Electron team prioritize this or let me know of a way to prioritize this.  This is <strong>critical</strong> for may app...</p>
<ul dir="auto">
<li>
<p dir="auto">2.0.2 and 2.0.3:</p>
</li>
<li>
<p dir="auto">Operating System (Platform and Version):</p>
</li>
</ul>
<p dir="auto">Ubuntu 18.04 and MacOS (latest)</p>
<ul dir="auto">
<li>Last known working Electron version:</li>
</ul>
<p dir="auto">None</p>
<p dir="auto"><strong>Expected Behavior</strong></p>
<p dir="auto">Registering or intercepting a stream protocol should work and the browser should show the proper content.</p>
<p dir="auto"><strong>Actual behavior</strong></p>
<p dir="auto">The browser actually shows an empty document with no content. No errors present.</p>
<p dir="auto">I've verified that the same code works fine with 'string' protocols. Just not 'stream' protocols.</p>
<p dir="auto">I created a repository here:</p>
<p dir="auto"><a href="https://github.com/burtonator/electron-protocol-examples">https://github.com/burtonator/electron-protocol-examples</a></p>
<p dir="auto">With all my examples.</p>
<p dir="auto">The key ones are:</p>
<p dir="auto">intercept-stream-protocol-http.js :  FAILS<br>
intercept-string-protocol-http.js: WORKS</p>
<p dir="auto">I simplified the code greatly and I use the examples in the documentation. I've read the protocol documentation 2-3x to see if I was missing something.  Does't seem to be the case.</p>
<p dir="auto">Additionally there is this case:</p>
<p dir="auto">intercept-stream-protocol-with-default-protocol.js</p>
<p dir="auto">... I'd like to have a way to revert to the default protocol handler if possible. A comment on my previous issue stated that this was possible but it still doesn't appear to work.  Doesn't work with string protocols either.</p>
<p dir="auto"><strong>To Reproduce</strong></p>
<p dir="auto">Just clone my repository and run the examples.</p>
<p dir="auto"><a href="https://github.com/burtonator/electron-protocol-examples">https://github.com/burtonator/electron-protocol-examples</a></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="git clone https://github.com/burtonator/electron-protocol-examples.git
cd electron-protocol-examples
npm install

## this will work and the content will be shown in the browser.
./node_modules/.bin/electron intercept-string-protocol-http.js

## this will NOT work and no content will be shown to the browser
./node_modules/.bin/electron intercept-stream-protocol-http.js
"><pre class="notranslate">git clone https://github.com/burtonator/electron-protocol-examples.git
<span class="pl-c1">cd</span> electron-protocol-examples
npm install

<span class="pl-c"><span class="pl-c">#</span># this will work and the content will be shown in the browser.</span>
./node_modules/.bin/electron intercept-string-protocol-http.js

<span class="pl-c"><span class="pl-c">#</span># this will NOT work and no content will be shown to the browser</span>
./node_modules/.bin/electron intercept-stream-protocol-http.js
</pre></div>
<p dir="auto"><strong>Screenshots</strong></p>
<h2 dir="auto">with sting protocol (working)</h2>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/45447/42126763-b0cb095a-7c41-11e8-973b-7c38b0ddf387.png"><img src="https://user-images.githubusercontent.com/45447/42126763-b0cb095a-7c41-11e8-973b-7c38b0ddf387.png" alt="image" style="max-width: 100%;"></a></p>
<h2 dir="auto">with stream protocol (not working)</h2>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/45447/42126756-a19d4290-7c41-11e8-973c-388b1ca27028.png"><img src="https://user-images.githubusercontent.com/45447/42126756-a19d4290-7c41-11e8-973c-388b1ca27028.png" alt="image" style="max-width: 100%;"></a></p>