Chrome extension to find links on a page: Passing values between two js files
<p>I am  making a chrome extension to catch links from a page and display in the popup of the extension. I use two javascript files, popup.js, toInject.js. The code of the two files:-</p>

<p>popup.js:</p>

<pre><code> chrome.tabs.executeScript(null,{file:"toInject.js"});
</code></pre>

<p>toInject.js:</p>

<pre><code>var linkTarget;
findLinks()
{

    var links=document.getElementByTagName('a');
    for(var i=0;i&lt;links.length;i++)
    {
        linkTarget=links[i].getAttribute('links');

    }


}
findLinks;
</code></pre>

<p>Now what i am trying is to get the links from toInject.js to popup.js ... How can i pass the values between these two js files? </p>
