title: Google Chrome Extension: Passing javascript variable to iframe src
body: <p>I have added "tabs" in permissions but this code doesnt work . The iframe works when the url is passed directly but not from the script.</p>
  
  <pre><code>    &lt;html&gt; 
      &lt;head&gt; 
      &lt;/head&gt;
      &lt;body &gt;
      &lt;iframe src="www" id="link" width="400" height="300"&gt;
      &lt;p&gt;Your browser does not support iframes.&lt;/p&gt;
      &lt;/iframe&gt;
      &lt;script&gt;
      var url1="xxx";
      chrome.tabs.getSelected(null,function(tab) {
      var url1= tab.url;
      });
      document.getElementById("link").src=url1;
      &lt;/script&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>