title: Disable the enter key Chrome extension
body: <p>I want to disable the <kbd>enter</kbd> key in Chrome extension using JavaScript for a particular page. For example: On a login page, instead of pressing <kbd>enter</kbd> to login the user should click on the Log in button.</p>
  <p>I am using message passing in my Chrome extension.</p>
  <pre><code>document.addEventListener(&quot;keydown&quot;, function(e) {
      var keys = e.which; 
    chrome.extension.sendRequest({method: &quot;getHTML&quot;, data: keys});
  });
  </code></pre>