<ul dir="auto">
<li>Electron Version: 2.0.6</li>
<li>Operating System (Platform and Version): Windows</li>
<li>Last known working Electron version: Unknown</li>
</ul>
<p dir="auto"><strong>Expected Behavior</strong><br>
Using the <code class="notranslate">navigator.geolocation.getCurrentPosition</code> method, it should return a success and a position<br>
object which contains a coords object. When I access it using a browser, it works as expected, using the same code but on chrome (Version 68.0.3440.84) instead of the electron application it works as expected. It does not work on my Electron application.</p>
<p dir="auto"><strong>Actual behavior</strong><br>
The error function gets called and I receive the following error: { Code: 2, Message: "Network location provider at '<a href="https://www.googleapis.com/" rel="nofollow">https://www.googleapis.com/</a>' : Returned error code 403" }. Code 2 meaning POSITION_UNAVAILABLE.</p>
<p dir="auto"><strong>To Reproduce</strong><br>
The error can be reproduced at this repo: <a href="https://github.com/garthtee/the-weather.git">https://github.com/garthtee/the-weather.git</a>. Commit 94e3e290ce2d7ae5f6ab0c7e171fd972bf2b4394.</p>
<p dir="auto">Setup my repo:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# Install dependencies
$ npm install

# Serve with hot reload at localhost:8080
$ npm run dev-server

# Start the electron applcation
$ npm run dev-app"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> Install dependencies</span>
$ npm install

<span class="pl-c"><span class="pl-c">#</span> Serve with hot reload at localhost:8080</span>
$ npm run dev-server

<span class="pl-c"><span class="pl-c">#</span> Start the electron applcation</span>
$ npm run dev-app</pre></div>
<ul dir="auto">
<li>Electron version: v1.6.6</li>
<li>Operating system: OSX</li>
</ul>
<h3 dir="auto">Expected behavior</h3>

<p dir="auto">Return the position object usually return by <code class="notranslate">navigator.geolocation.getCurrentPosition</code></p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">Nothing is returned, yet this works on a regular chrome browser</p>

<h3 dir="auto">How to reproduce</h3>
<p dir="auto">this code in my <code class="notranslate">index.html</code> file</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function initMap() {
      let location;
      if(&quot;geolocation&quot; in navigator) {
        console.log('Location services available')
        navigator.geolocation.getCurrentPosition(function(position) {
          console.log(position)
          location = {
            lat: position.coords.latitude,
            lng: position.coords.longitude
          }
          console.log(location)
          let map = new google.maps.Map(document.getElementById('map'), {
    				center: location,
    				scrollwheel: false,
    				zoom: 7
    			});
        });
      }
      else {
        document.getElementById('status').innerHTML = &quot;Location Services not available!&quot;
        return 0
      }
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">initMap</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-k">let</span> <span class="pl-s1">location</span><span class="pl-kos">;</span>
      <span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-s">"geolocation"</span> <span class="pl-k">in</span> <span class="pl-s1">navigator</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'Location services available'</span><span class="pl-kos">)</span>
        <span class="pl-s1">navigator</span><span class="pl-kos">.</span><span class="pl-c1">geolocation</span><span class="pl-kos">.</span><span class="pl-en">getCurrentPosition</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">position</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
          <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">position</span><span class="pl-kos">)</span>
          <span class="pl-s1">location</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
            <span class="pl-c1">lat</span>: <span class="pl-s1">position</span><span class="pl-kos">.</span><span class="pl-c1">coords</span><span class="pl-kos">.</span><span class="pl-c1">latitude</span><span class="pl-kos">,</span>
            <span class="pl-c1">lng</span>: <span class="pl-s1">position</span><span class="pl-kos">.</span><span class="pl-c1">coords</span><span class="pl-kos">.</span><span class="pl-c1">longitude</span>
          <span class="pl-kos">}</span>
          <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">location</span><span class="pl-kos">)</span>
          <span class="pl-k">let</span> <span class="pl-s1">map</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">google</span><span class="pl-kos">.</span><span class="pl-c1">maps</span><span class="pl-kos">.</span><span class="pl-c1">Map</span><span class="pl-kos">(</span><span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">getElementById</span><span class="pl-kos">(</span><span class="pl-s">'map'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
    				<span class="pl-c1">center</span>: <span class="pl-s1">location</span><span class="pl-kos">,</span>
    				<span class="pl-c1">scrollwheel</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
    				<span class="pl-c1">zoom</span>: <span class="pl-c1">7</span>
    			<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
      <span class="pl-kos">}</span>
      <span class="pl-k">else</span> <span class="pl-kos">{</span>
        <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">getElementById</span><span class="pl-kos">(</span><span class="pl-s">'status'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">innerHTML</span> <span class="pl-c1">=</span> <span class="pl-s">"Location Services not available!"</span>
        <span class="pl-k">return</span> <span class="pl-c1">0</span>
      <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>

<p dir="auto">I have forked the quick start and added geolocation code, same set up to run: <a href="https://github.com/Vikaton/electron-quick-start">https://github.com/Vikaton/electron-quick-start</a></p>
<p dir="auto">Am I missing something? Thanks!</p>