<ul dir="auto">
<li>Output of <code class="notranslate">node_modules/.bin/electron --version</code>: 3.0.5</li>
<li>Operating System (Platform and Version): travis ubuntu 14</li>
<li>Output of <code class="notranslate">node_modules/.bin/electron --version</code> on last known working Electron version (if applicable): the 2 series does not seem to have this issue</li>
</ul>
<p dir="auto"><strong>Expected Behavior</strong><br>
window.setTitle, when issued on did-finish-load, should always succeed</p>
<p dir="auto"><strong>Actual behavior</strong><br>
With electron 3.0, we are seeing spurious failures.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    unknown error: Cannot call function 'setTitle' on missing remote object 1
Error: Cannot call function 'setTitle' on missing remote object 1
    at throwRPCError (/home/travis/build/.../electron.asar/browser/rpc-server.js:145:17)
    at EventEmitter.&lt;anonymous&gt; (/home/travis/build/.../electron.asar/browser/rpc-server.js:357:7)
    at EventEmitter.emit (events.js:182:13)
    at WebContents.&lt;anonymous&gt; (/home/travis/build/.../electron.asar/browser/api/web-contents.js:293:13)
    at WebContents.emit (events.js:182:13)
  Error: An unknown server-side error occurred while processing the command.
      at execute(&lt;Function&gt;, &quot;setTitle&quot;, Create an action with limits, using let, &quot;require&quot;) - api.js:300:19"><pre class="notranslate">    unknown <span class="pl-s1">error</span>: <span class="pl-v">Cannot</span> <span class="pl-s1">call</span> <span class="pl-k">function</span> <span class="pl-s">'setTitle'</span> <span class="pl-s1">on</span> <span class="pl-s1">missing</span> <span class="pl-s1">remote</span> <span class="pl-s1">object</span> <span class="pl-c1">1</span>
Error: <span class="pl-v">Cannot</span> <span class="pl-s1">call</span> <span class="pl-k">function</span> <span class="pl-s">'setTitle'</span> <span class="pl-s1">on</span> <span class="pl-s1">missing</span> <span class="pl-s1">remote</span> <span class="pl-s1">object</span> <span class="pl-c1">1</span>
    <span class="pl-s1">at</span><span class="pl-kos"></span> <span class="pl-en">throwRPCError</span> <span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span>home<span class="pl-c1">/</span>travis</span><span class="pl-c1">/</span><span class="pl-s1">build</span><span class="pl-c1">/</span>...<span class="pl-c1">/</span><span class="pl-s1">electron</span><span class="pl-kos">.</span><span class="pl-c1">asar</span><span class="pl-c1">/</span><span class="pl-s1">browser</span><span class="pl-c1">/</span><span class="pl-s1">rpc</span><span class="pl-c1">-</span><span class="pl-s1">server</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">145</span>:<span class="pl-c1">17</span><span class="pl-kos">)</span>
    <span class="pl-s1">at</span><span class="pl-kos"></span> <span class="pl-v">EventEmitter</span><span class="pl-kos">.</span><span class="pl-c1">&lt;</span><span class="pl-s1">anonymous</span><span class="pl-c1">&gt;</span> <span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span>home<span class="pl-c1">/</span>travis</span><span class="pl-c1">/</span><span class="pl-s1">build</span><span class="pl-c1">/</span>...<span class="pl-c1">/</span><span class="pl-s1">electron</span><span class="pl-kos">.</span><span class="pl-c1">asar</span><span class="pl-c1">/</span><span class="pl-s1">browser</span><span class="pl-c1">/</span><span class="pl-s1">rpc</span><span class="pl-c1">-</span><span class="pl-s1">server</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">357</span>:<span class="pl-c1">7</span><span class="pl-kos">)</span>
    <span class="pl-s1">at</span><span class="pl-kos"></span> <span class="pl-v">EventEmitter</span><span class="pl-kos">.</span><span class="pl-en">emit</span> <span class="pl-kos">(</span><span class="pl-s1">events</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">182</span>:<span class="pl-c1">13</span><span class="pl-kos">)</span>
    <span class="pl-s1">at</span><span class="pl-kos"></span> <span class="pl-v">WebContents</span><span class="pl-kos">.</span><span class="pl-c1">&lt;</span><span class="pl-s1">anonymous</span><span class="pl-c1">&gt;</span> <span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span>home<span class="pl-c1">/</span>travis</span><span class="pl-c1">/</span><span class="pl-s1">build</span><span class="pl-c1">/</span>...<span class="pl-c1">/</span><span class="pl-s1">electron</span><span class="pl-kos">.</span><span class="pl-c1">asar</span><span class="pl-c1">/</span><span class="pl-s1">browser</span><span class="pl-c1">/</span><span class="pl-s1">api</span><span class="pl-c1">/</span><span class="pl-s1">web</span><span class="pl-c1">-</span><span class="pl-s1">contents</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">293</span>:<span class="pl-c1">13</span><span class="pl-kos">)</span>
    <span class="pl-s1">at</span><span class="pl-kos"></span> <span class="pl-v">WebContents</span><span class="pl-kos">.</span><span class="pl-en">emit</span> <span class="pl-kos">(</span><span class="pl-s1">events</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">182</span>:<span class="pl-c1">13</span><span class="pl-kos">)</span>
  <span class="pl-v">Error</span>: <span class="pl-v">An</span> <span class="pl-s1">unknown</span> <span class="pl-s1">server</span><span class="pl-c1">-</span><span class="pl-s1">side</span> <span class="pl-s1">error</span> <span class="pl-s1">occurred</span> <span class="pl-s1">while</span> <span class="pl-s1">processing</span> <span class="pl-s1">the</span> <span class="pl-s1">command</span><span class="pl-kos">.</span>
      <span class="pl-c1">at</span> <span class="pl-s1">execute</span><span class="pl-kos">(</span><span class="pl-c1">&lt;</span><span class="pl-ent">Function</span><span class="pl-c1">&gt;</span>, "setTitle", Create an action with limits, using let, "require") - api.js:300:19</pre></div>
<p dir="auto"><strong>To Reproduce</strong><br>
We will see if we can bottle up this issue</p>
<p dir="auto"><strong>Screenshots</strong></p>
<p dir="auto"><strong>Additional Information</strong></p>
<ul dir="auto">
<li>Electron version: 1.8.2</li>
<li>Operating system: Deepin Linux 15.5 x86_64</li>
</ul>
<h3 dir="auto">How to reproduce</h3>
<ul dir="auto">
<li>register 'CommandOrControl+C' to gloablShortcuts in main.js</li>
</ul>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="app.on('ready', function () {
  createWindow()
  // Then I register an shortcut
  const ret = globalShortcut.register('CommandOrControl+C', () =&gt; {
    console.log('CommandOrControl+C is pressed, do something special')
    // As 'CommandOrControl+C' is the common behavior to update clipboard in OS
    // Expect that my special action registered here could be triggered, and also the OS default behavior
  })
  if (!ret) {
    console.log('registration on CommandOrControl+C failed')
  }
  console.log(`CommandOrControl+C register ${globalShortcut.isRegistered('CommandOrControl+C')}`)
})"><pre class="notranslate"><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-k">function</span> <span class="pl-kos">(</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-c">// Then I register an shortcut</span>
  <span class="pl-k">const</span> <span class="pl-s1">ret</span> <span class="pl-c1">=</span> <span class="pl-s1">globalShortcut</span><span class="pl-kos">.</span><span class="pl-en">register</span><span class="pl-kos">(</span><span class="pl-s">'CommandOrControl+C'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</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-s">'CommandOrControl+C is pressed, do something special'</span><span class="pl-kos">)</span>
    <span class="pl-c">// As 'CommandOrControl+C' is the common behavior to update clipboard in OS</span>
    <span class="pl-c">// Expect that my special action registered here could be triggered, and also the OS default behavior</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-c1">!</span><span class="pl-s1">ret</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-s">'registration on CommandOrControl+C failed'</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-s">`CommandOrControl+C register <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">globalShortcut</span><span class="pl-kos">.</span><span class="pl-en">isRegistered</span><span class="pl-kos">(</span><span class="pl-s">'CommandOrControl+C'</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<ul dir="auto">
<li>do something special when 'CommandOrControl+C' triggered</li>
<li>As 'CommandOrControl+C' is OS common behavior, would update things in clipboard, but current would not</li>
</ul>
<h3 dir="auto">Actual behavior</h3>
<ul dir="auto">
<li>'CommandOrControl+C' event is swallowed by globalShortcuts, and the OS could not update things in clipboard</li>
</ul>
<h3 dir="auto">Expected behavior</h3>
<ul dir="auto">
<li>keys registered in globalShortcuts could keep popup to system, not to swallow or interrupt</li>
</ul>
<p dir="auto">this is related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="276264334" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/11226" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/11226/hovercard" href="https://github.com/electron/electron/issues/11226">#11226</a></p>