title: Submitting form in a chrome extension doesn't work
body: <p>I'm building a chrome extension that consists on a form that when submitted executes <code>onsubmit="submit(); return false;"</code>.</p>
  
  <p>I know the method submit works because I created a button outside the form with <code>onclick="submit()"</code> and that works perfectly.</p>
  
  <p>Here is the form:</p>
  
  <pre><code>&lt;form method="post" name="gaffeForm" onsubmit="submit(this); return false;"&gt;
      &lt;div&gt;
          &lt;div class="submitField"&gt;
              &lt;p class="formp"&gt;Title :&lt;/p&gt;
              &lt;input type="text" name="title" size="50" id="pageTitle" placeholder="Title" required /&gt;
          &lt;/div&gt;
          &lt;div class="submitField"&gt;
              &lt;p class="formp"&gt;URL :&lt;/p&gt;
              &lt;input type="url" name="url" size="50" id="pageURL" placeholder="URL" required /&gt;
          &lt;/div&gt;
          &lt;div class="submitField"&gt;
              &lt;p class="formp"&gt;Error :&lt;/p&gt;
              &lt;textarea name="gaffe" rows="5" cols="50" id="pageGaffe" placeholder="Gaffe" required &gt;&lt;/textarea&gt;
          &lt;/div&gt;
          &lt;div class="submitField"&gt;
              &lt;p class="formp"&gt;Comment :&lt;/p&gt;
              &lt;textarea name="comment" rows="5" cols="50" id="gaffeComment" placeholder="Your comment on the gaffe" required &gt;&lt;/textarea&gt;
          &lt;/div&gt;
          &lt;div class="submitField"&gt;
              &lt;p class="formp"&gt;Tags :&lt;/p&gt;
              &lt;input type="text" name="tags" size="50" id="gaffeTags" placeholder="Separate the tags with a comma" required /&gt;
          &lt;/div&gt;
          &lt;div id="GaffeSubmit"&gt;
              &lt;input type="submit" value="Submit" /&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And here is the <code>submit()</code> function:</p>
  
  <pre><code>function submit(f) {
      var xhr = new XMLHttpRequest();
  
      var title = $('#pageTitle').val().replace(/\//g, "%2F");
      var url = $('#pageURL').val().replace(/http:\/\//, "").replace(/https:\/\//, "").replace(/\//g, "%2F");
      var gaffe = $('#pageGaffe').val().replace(/\//g, "%2F");
      var comment = $('#gaffeComment').val().replace(/\//g, "%2F");
      var tags = $('#gaffeTags').val().replace(/\//g, "%2F");
  
      xhr.open("POST", "http://localhost:3000/F0ETF87dar8F7deO92K/" + title + "/" + url + "/" + gaffe + "/" + comment + "/" + tags, true);
      xhr.onreadystatechange = function() {
          if (xhr.readyState == 4) {
              if (req.status == 200) window.close();
          }
      };
      xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      xhr.setRequestHeader("Connection", "close");
      xhr.send();
      return false;
  }
  </code></pre>
  
  <p>So, when I click submit with all my fields filled in what happens is that the fields comment and tags go blank, and that's it... I've tried a lot of different ways of executing <code>submit()</code> but none have worked... Thank you.</p>