title: messaging between content script and background page in a chrome extension is not working as it is supposed to be
body: <p>I post the code below:</p>
  
  <p>manifest.json</p>
  
  <pre><code>{
    "manifest_version": 2,
  
    "name": "Demo",
    "description": "all_frames test",
    "version": "1.0",
  
    "background": {
      "scripts": ["background.js"]
    },
  
    "content_scripts": [{
          "matches":    ["*://*/*"],
          "js":         ["content.js"],
          "all_frames": true
      }],
  
    "permissions": [
            "tabs",
            "*://*/*"
     ]
  }
  </code></pre>
  
  <p>background.js</p>
  
  <pre><code>chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
      var tabStatus = changeInfo.status;
  
      if (tabStatus == 'complete') {
  
          function return_msg_callback() {
              console.log('Got a msg from cs...')
          }
  
          chrome.tabs.sendMessage(tabId, {
              text: 'hey_cs'
          }, return_msg_callback);
      }
  
  });
  </code></pre>
  
  <p>content.js</p>
  
  <pre><code>/* Listen for messages */
  chrome.runtime.onMessage.addListener(function(msg, sender, sendResponse) {
      /* If the received message has the expected format... */
      if (msg.text &amp;&amp; (msg.text == 'hey_cs')) {
          console.log('Received a msg from bp...')
          sendResponse('hey_bp');
      }
  });
  </code></pre>
  
  <p>Then, if I go to a site that includes multiples cross-origin iFrames, e.g., <a href="http://www.sport.es/" rel="noreferrer">http://www.sport.es/</a> you would see that all the iFrames within the page receive the message from the background page but only one of them is able to response back. Is this a normal behavior?</p>
  
  <p>Thanks in advance for your answer.</p>