title: Returning all attribute names inside of a document via Chrome Extension?
body: <p>I am developing a Chrome Extension for a website known as <strong><a href="http://www.roblox.com/" rel="nofollow">Roblox</a></strong>. </p>
  
  <p>The forum has a lot of advantages, and some disadvantages. There have been other Chrome Extensions for this site, but they just do not seem to fulfill my needs. </p>
  
  <p>This was my first encounter with making a legit Chrome extension, so I went ahead and read the entire wiki.</p>
  
  <p>But when i tested my code it didn't work. This was a little odd because the error log didn't display any errors or <code>console.log()</code> lines.</p>
  
  <p>What am I doing incorrectly? <br /> <br /> <br /> 
  manifest.json: <br /> </p>
  
  <pre><code>{
      "name": "Roblox ID Display", 
      "version": "1.0", 
      "manifest_version": 2, 
      "description": "Roblox ID Display displays the ID of forum posts.",
      "browser_action": { 
          "default_icon": "icon.png"
      }, 
      "permissions": [
          "http://www.roblox.com/" 
      ],
      "content_scripts": [
          {
              "matches": ["http://www.roblox.com/Forum/ShowPost.aspx"],
              "js": ["content.js"]
          }
      ]
  }
  </code></pre>
  
  <p><br /> 
  content.js:</p>
  
  <pre><code>var elements = Array.filter(document.getElementsByTagName('a'), function(elem){
      n = elem.getAttribute("name");
      x = n.replace([0-9]i, ""); 
      console.log(n); 
      console.log(x); 
      console.log(x == n); 
      return x == n;
  });
  var names = []; 
  for (var i = 0; i &lt; elements.length; i++) {
      console.log(elements[i]); 
      names.push(elements[i].getAttribute("name")); 
  }
  for (var i = 0; i &lt; names.length; i++) { 
      console.log(names[i]); 
  }
  </code></pre>