title: Opening new tab from Chrome Extension to search in Google
body: <p>The idea was to make a simple Chrome Extension to make a Google search on the specific site instead of writing a site:whatever.whatever in a Google search field.
  Here's my popup.html:</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
      &lt;title&gt;HTP Searcher Extension's Popup&lt;/title&gt;
      &lt;link rel="stylesheet" href="style.css"&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;form action="https://www.google.com/search" method="get" target="_blank" onsubmit="companiesSearch()"&gt;
          &lt;input type="text" id="finalquery" name="q" value="" style="display:none;"&gt;
          &lt;input type="text" id="site" name="othername" value=" site:www.park.by" style="display:none;"&gt;
          &lt;input type="text" id="entertext" name="entertext"&gt;
          &lt;input type="submit" class="sendsubmit" name="submit"&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>And popup.js:</p>
  
  <pre><code>function companiesSearch() {
      var value1 = document.getElementById('entertext').value;
      var value2 = document.getElementById('site').value;
      var value3 = value1 + value2;
      document.getElementById('finalquery').setAttribute('value', value3);
  }
  </code></pre>
  
  <p>If to make a simple html file + js file like in the construction above, everything works smoothly. If to make it an extension, it works only without adding javascript: if to make an easy one input form it opens a new tab and shoes the search results. But after adding a script and after submit the search request blinks in the url line and than an empty Google search appears. Such error can by seen in console:</p>
  
  <pre><code>Uncaught (in promise) TypeError: Request scheme 'chrome-extension' is unsupported
  at newtab-serviceworker.js:61
  at &lt;anonymous&gt;
  </code></pre>
  
  <p>By the way, my manifest.json:</p>
  
  <pre><code>{
      "manifest_version": 2,
      "name": "HTP Searcher",
      "description": "This extension searches companies",
      "version": "1.0",
      "browser_action": {
          "default_icon": "icon.png",
          "default_popup": "popup.html"
      },
      "background": {
          "scripts": ["popup.js"]
      },
      "permissions": [
          "activeTab",
          "tabs",
          "https://ajax.googleapis.com/"
      ]
  }
  </code></pre>
  
  <p>Thank everyone in advance, completely new to writing extensions.</p>