title: Scrape Javascript files from web page using chrome extension
body: <p>I am trying to scrape javascript function calls from an extension and trying it to save in JSON, now I wrote this to see how many javascript files are there in the domain. Next how to select each javascript file and scrape function calls and variable using chrome extension.</p>
  <pre><code>window.addEventListener('load',function(){
  
    // Page loaded. Fetch all the scripts
    let all_scripts = document.querySelectorAll('script');
    for(let i =0;i&lt;all_scripts.length;i++){
      if (all_scripts[i].src)
        console.log(&quot;Detected script: &quot;+all_scripts[i].src);
      else
        console.log(&quot;Detected local script with inline execution&quot;);
    }
  });
  </code></pre>
  <p>Thanks for your help in advance!</p>