title: How can I edit a manifest.json file from a JS file?
body: <p>I'm making a Google Chrome extension that parses a Twitter feed's source code when the user inputs the handle. I'm aware that you cannot extract an external site's source code unless you give it permission in the <code>manifest.json</code> file. However, the URL in my case will vary based on the Twitter handle that the user inputs, so how can I edit the manifest file directly from my <code>popup.js</code> script?</p>
  
  <p>For example, I want something like this:</p>
  
  <pre><code>{
      "permissions": [
          "http://www.twitter.com/" + handle + "/with_replies"
      ]
  }
  </code></pre>
  
  <p>in my <code>manifest.json</code> file and</p>
  
  <pre><code>var handle = "CNN";
  $(document).ready(function() {
      $.get("http://www.twitter.com/" + handle + "/with_replies", function(data) {
          $("#body").text(data);
      });
  });
  </code></pre>
  
  <p>to return the content of the Twitter feed for CNN. </p>
  
  <p>************************************************ UPDATE ************************************************</p>
  
  <p>So to test to see if my code works, I changed my <code>manifest.json</code> file to include <code>http://www.twitter.com/*</code> as a permission, and I changed my jQuery code to:</p>
  
  <pre><code>$.get("https://twitter.com/", function(data) {
      $("h5").text(data);
      });
  });
  </code></pre>
  
  <p>This is inside an event listener that listens for a button click, so this should change the text of the h5 element to the source of the webpage, but it doesn't. I've tried replacing <code>https://www.twitter.com/*</code> with <code>https://www.twitter.com/</code> and it still doesn't work. But if I replace the jQuery code with something simple like <code>$("h5").text("Hello world!");</code>, it works fine. Is there something wrong with my jQuery code to extract the page's content?</p>
  
  <p>This is what the permissions section in my manifest file looks like:</p>
  
  <pre><code>"permissions": [
   "activeTab",
   "storage",
   "https://twitter.com/*"
  ]
  </code></pre>