<p dir="auto">I added my own custom protocol, which i create a BrowserWindow from using <code class="notranslate">mist://interface</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="protocol.registerHttpProtocol('mist', function(request, callback) {

    var call = {
        url: (request.url.indexOf('mist://interface') !== -1) ? global.interfaceAppUrl + request.url.replace('mist://interface','') : '',
        method: request.method,
        referrer: request.referrer
    };

    console.log(call);

    callback(call);

}, function (error) {
  if (error)
    console.error('Failed to register protocol')
});"><pre class="notranslate"><span class="pl-s1">protocol</span><span class="pl-kos">.</span><span class="pl-en">registerHttpProtocol</span><span class="pl-kos">(</span><span class="pl-s">'mist'</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">request</span><span class="pl-kos">,</span> <span class="pl-s1">callback</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>

    <span class="pl-k">var</span> <span class="pl-s1">call</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
        <span class="pl-c1">url</span>: <span class="pl-kos">(</span><span class="pl-s1">request</span><span class="pl-kos">.</span><span class="pl-c1">url</span><span class="pl-kos">.</span><span class="pl-en">indexOf</span><span class="pl-kos">(</span><span class="pl-s">'mist://interface'</span><span class="pl-kos">)</span> <span class="pl-c1">!==</span> <span class="pl-c1">-</span><span class="pl-c1">1</span><span class="pl-kos">)</span> ? <span class="pl-s1">global</span><span class="pl-kos">.</span><span class="pl-c1">interfaceAppUrl</span> <span class="pl-c1">+</span> <span class="pl-s1">request</span><span class="pl-kos">.</span><span class="pl-c1">url</span><span class="pl-kos">.</span><span class="pl-en">replace</span><span class="pl-kos">(</span><span class="pl-s">'mist://interface'</span><span class="pl-kos">,</span><span class="pl-s">''</span><span class="pl-kos">)</span> : <span class="pl-s">''</span><span class="pl-kos">,</span>
        <span class="pl-c1">method</span>: <span class="pl-s1">request</span><span class="pl-kos">.</span><span class="pl-c1">method</span><span class="pl-kos">,</span>
        <span class="pl-c1">referrer</span>: <span class="pl-s1">request</span><span class="pl-kos">.</span><span class="pl-c1">referrer</span>
    <span class="pl-kos">}</span><span class="pl-kos">;</span>

    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">call</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-s1">callback</span><span class="pl-kos">(</span><span class="pl-s1">call</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">error</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">error</span><span class="pl-kos">)</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">error</span><span class="pl-kos">(</span><span class="pl-s">'Failed to register protocol'</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">It loads the initial page fine, but none of the linked scripts seemed to be loaded later.<br>
I also tried adding a script tag using javascript manually:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var script = document.createElement('script');
script.type = 'text/javascript';
script.src = '/packages/meteor.js?19730f4ff059088b3f7f14c0672d155218a1802d4';    

document.getElementsByTagName('body')[0].appendChild(script);"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">script</span> <span class="pl-c1">=</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">createElement</span><span class="pl-kos">(</span><span class="pl-s">'script'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">script</span><span class="pl-kos">.</span><span class="pl-c1">type</span> <span class="pl-c1">=</span> <span class="pl-s">'text/javascript'</span><span class="pl-kos">;</span>
<span class="pl-s1">script</span><span class="pl-kos">.</span><span class="pl-c1">src</span> <span class="pl-c1">=</span> <span class="pl-s">'/packages/meteor.js?19730f4ff059088b3f7f14c0672d155218a1802d4'</span><span class="pl-kos">;</span>    

<span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">getElementsByTagName</span><span class="pl-kos">(</span><span class="pl-s">'body'</span><span class="pl-kos">)</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">appendChild</span><span class="pl-kos">(</span><span class="pl-s1">script</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">But i can't see this protocoll handler beeing called and the js doesn't load and execute.</p>
<p dir="auto">Hint: this seems to happen if the url, is relative or absolute and not contains the protocol.<br>
Though by web standards, relative or absolute URLs should get the protocol of the current location.</p>
<p dir="auto">some webpage omit the <code class="notranslate">http</code> prefix to minify the page, like <code class="notranslate">http://taobao.com</code><br>
electron now can not recognize this kind of url, and will log error like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[22608:0521/234915:INFO:CONSOLE(0)] &quot;Not allowed to load local resource: file://g.alicdn.com/kg/offline/3.0.1/index-min.js?t=20131121234724.js&quot;, source: http://www.taobao.com/ (0)"><pre class="notranslate"><code class="notranslate">[22608:0521/234915:INFO:CONSOLE(0)] "Not allowed to load local resource: file://g.alicdn.com/kg/offline/3.0.1/index-min.js?t=20131121234724.js", source: http://www.taobao.com/ (0)
</code></pre></div>