title: How to replace input field selected text with Chrome extension context menu?
body: <p>I am looking for a simple solution to change input field value with context menu trigger.</p>
  
  <p>Let's say changing to <code>bar</code> will be enough, I'll try to add some processing later.</p>
  
  <p><a href="http://i.stack.imgur.com/fGX2p.png" rel="nofollow">This is how it should work</a></p>
  
  <p>manifest.json:</p>
  
  <pre><code>{
    "manifest_version": 2,
    "background" : { "scripts": ["background.js"] },
    "permissions": [ "contextMenus", "http://*/*", "https://*/*" ],
    "name": "test plugin",
    "version": "0.1"
  }
  </code></pre>
  
  <p>background.js:</p>
  
  <pre><code>function getClickHandler() {
    //magic here
  };
  
  chrome.contextMenus.create({
    "title" : "change to 'bar'",
    "type" : "normal",
    "contexts" : ["editable"],
    "onclick" : getClickHandler()
  });
  </code></pre>