title: Chrome: Error in event handler for runtime.onMessage
body: <p>I'm trying to return all window instances within a Chrome Extension, but I get:</p>
  
  <blockquote>
    <p>Error in event handler for runtime.onMessage: Error: Invocation of form windows.getAll() doesn't match definition windows.getAll(optional object getInfo, function callback)</p>
  </blockquote>
  
  <p>I've stripped my app down to the bare minimum, the following is my actual setup when I get the error message. The intent is that when I press the space bar, <code>chrome.windows.getAll()</code> gets called and something shows up in the background console. I do get "Message received" in the console before the error.</p>
  
  <p>Any ideas what I'm doing wrong, or even what the error means? I've left the exact error message at the bottom</p>
  
  <p>My Chrome version is: <code>33.0.1750.152</code></p>
  
  <hr>
  
  <h3>manifest.json</h3>
  
  <pre><code>{
      "manifest_version": 2,
  
      "name":         "Alt Tilde",
      "version":      "0.0.1",
  
      "background": {
          "scripts":  ["js/bg.js"]
      },
  
      "content_scripts": [{
          "matches":  ["&lt;all_urls&gt;"],
          "js":       ["js/content.js"]
      }]
  }
  </code></pre>
  
  <h3>js/content.js</h3>
  
  <pre><code>document.addEventListener('keydown', function(e){
      if(e.keyCode == 32)
          chrome.runtime.sendMessage({command: 'switch-window'})
  })
  </code></pre>
  
  <h3>js/bg.js</h3>
  
  <pre><code>chrome.runtime.onMessage.addListener(function(){
      console.log('Message received')
      console.log(chrome.windows.getAll())
  })
  </code></pre>
  
  <hr>
  
  <h2>Full Error Message</h2>
  
  <pre><code>Error in event handler for runtime.onMessage: Error: Invocation of form windows.getAll() doesn't match definition windows.getAll(optional object getInfo, function callback)
      at Object.normalizeArgumentsAndValidate (extensions::schemaUtils:113:11)
      at Object.&lt;anonymous&gt; (extensions::binding:307:30)
      at chrome-extension://aijclfleiopkccfielfjknhgpajnclah/js/bg.js:2:32
      at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)
      at Event.dispatchToListener (extensions::event_bindings:394:22)
      at Event.dispatch_ (extensions::event_bindings:378:27)
      at Event.dispatch (extensions::event_bindings:400:17)
      at messageListener (extensions::messaging:192:31)
      at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)
      at Event.dispatchToListener (extensions::event_bindings:394:22) extensions::event_bindings:382
  Event.dispatch_ extensions::event_bindings:382
  Event.dispatch extensions::event_bindings:400
  messageListener extensions::messaging:192
  Event.dispatchToListener extensions::event_bindings:394
  Event.dispatch_ extensions::event_bindings:378
  Event.dispatch extensions::event_bindings:400
  dispatchOnMessage extensions::messaging:307
  </code></pre>