title: Chrome extension only runs sometimes
body: <p>I recently started learning a little javascript and made a basic chrome extension, but the problem is that it only sometimes works. What I want it to do is replace the text in any input box to be that of the variable specified in the code, and it works, but not all the time. When I load a site, for example google.com, it might work as I type in the search box, but then doesn't if I refresh the page, and then it might works if I refresh again. </p>
  
  <p>here is my code:</p>
  
  <p>manifest.json</p>
  
  <pre><code>{
    "manifest_version": 2,
    "name": "My Cool Extension",
    "version": "0.1",
  
    "content_scripts": [
      {
        "matches": [
          "&lt;all_urls&gt;"
        ],
        "js": ["jQuery.js", "content.js"]
      }
    ],
  
    "browser_action": {
          "default_icon": "icon.png"
     } 
  }
  </code></pre>
  
  <p>content.js</p>
  
  <pre><code>window.onload = function () {
      var inputs = document.getElementsByTagName('input');
      for (i = 0; i &lt; inputs.length; i++) {
          inputs[i].onkeyup = function () {
  
              var text = "Text to fill in";
              this.value = text.substring(0, this.value.length);
  
          };
      }
  };
  </code></pre>
  
  <p>I am waiting for the window to fully load before typing.
  I have also run it on another computer, same problem.
  Anyone have any ideas?</p>