title: Google chrome extension to open the New Tab page
body: <p>I am trying to make a simple chrome extension.
  It is supposed to add an item "Open new tab" in the 'windows system tray chrome icon context menu' (similar to how the checker plus for gmail extension has done; see the second image given below).</p>
  
  <p>when I click the option, chrome is supposed to <em>(check if any window is open. If yes, then it is supposed to)</em> open a new tab page. If no windows are open, then it is supposed to open a new chrome window with the new tab page showing.</p>
  
  <p>What I have done till now:</p>
  
  <h2>manifest.json</h2>
  
  <pre><code>{  
    "manifest_version": 2,
  
    "name": "Open New Tab",  
    "description": "This extension open a new tab page",  
    "version": "1.0",  
    "browser_action": {  
        "default_icon": "icon.png"
    },  
    "background":{  
      "scripts":["background.js"],  
      "persistent": false
    },  
    "permissions": [
      "background",
      "activeTab"
    ]
  }
  </code></pre>
  
  <h2>background.js</h2>
  
  <pre><code>chrome.browserAction.onClicked.addListener(function(tab)   
  {  
      chrome.tabs.create({ url: "chrome://newtab" });  
  }
  );
  </code></pre>
  
  <h2>background.html</h2>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  chrome.browserAction.onClicked.addListener(function(window)                         
  {  
      chrome.windows.create({url: "chrome://newtab", type: "normal"});  
  }
  );
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have already loaded this extension.
  The effects of my extension on chrome so far:<br>
  1) Chrome window is already open.
  My icon shows up in the list of extensions and is clickable.<a href="https://i.stack.imgur.com/KpLC6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KpLC6.jpg" alt="enter image description here"></a><br>
   On clicking, a 'new tab' page is opened in the same window. This is correct. (Though I don't need this. For now, let it be.)</p>
  
  <p>2) Chrome window is closed, and chrome is allowed to run in the background. Rightclick the chrome tray icon. My extension menu 'Open a new tab' shows up in the menu.<a href="https://i.stack.imgur.com/0xA89.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0xA89.jpg" alt="enter image description here"></a><br>
  This is also correct. On clicking it, a new chrome window is created. (Currently, I have not yet checked if a window already exists. That is to come later.). </p>
  
  <p>The problem is that, in the new window that opens, instead of the 'new tab' page, chrome automatically opens the 'chrome://extensions' URL. This is wrong, and I cannot understand why the extensions page is opening. I want to open the new tab page, and i am passing the 'chrome://newtab' URL. How do I make chrome open the new tab page from here? Chrome works correctly when I start it from my desktop icon or windows start menu. So, the problem seems to be something with my code.  </p>
  
  <p>Any help is appreciated.</p>