title: content script can not handle message from background after chrome.tabs.executeScript
body: <p>chrome : 54.0.2840.87</p>
  
  <p>This is my first chrome extension and I am new to javascript.</p>
  
  <p>my manifest.json : </p>
  
  <pre><code>"background": {
      "persistent": true,
      "scripts": ["lib/jquery/jquery-3.1.1.min.js", "background.js"]
  },
  "content_scripts": [{
      "matches": ["&lt;all_urls&gt;"],
      "js": ["content-scriptA.js",
             "lib/jquery/jquery-3.1.1.min.js"],
      "css": ["res/css/ms-0.0.1.css"]
  }],
  "content_security_policy": "script-src 'self' https://connect.facebook.net; object-src 'self'",
  "permissions": [
      "activeTab",
      "tabs",
      "storage",
      "identity",
      "&lt;all_urls&gt;"
  ],
  </code></pre>
  
  <p>background.js :</p>
  
  <pre><code>chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
    if (message_from_A) {
      chrome.tabs.query({currentWindow: true, active: false}, function(tabs) {
        chrome.tabs.executeScript(null, {file: "content-scriptB.js"});
      });
    }
    if (message_from_B) {
      chrome.tabs.query({currentWindow: true, active: false}, function(tabs) {
        chrome.tabs.sendMessage(tabs[0].id, {to : "A", do: "..."});
      });
  });
  </code></pre>
  
  <p>and </p>
  
  <pre><code>  chrome.runtime.onMessage.addListener(function(request, sender, response) {
        console.log("...");
    });
  </code></pre>
  
  <p>handlers for content-scriptA.js, content-scriptB.js each.</p>
  
  <p>content-scriptA is for rendering A.html, content-scriptB is for rendering B.html in the same iframe while using my extension.</p>
  
  <p>What I want do is when user wants to go back to A.html from B.html, render A.html with content-scriptA.js. </p>
  
  <p>When I execute content-scriptB.js I thought both A.js and B.js are going, but when I sendMessage from background, none of them answered.</p>
  
  <p>I tried to use port, reload same script and so on, but still can't find the way TT</p>
  
  <p>Thanks for any help, and reading my question.</p>