<!--
Thanks for opening an issue! A few things to keep in mind:

- The issue tracker is only for bugs and feature requests.
- Before reporting a bug, please try reproducing your issue against
  the latest version of Electron.
- If you need general advice, join our Slack: http://atom-slack.herokuapp.com
-->

* Electron version: 1.6.1
* Operating system: macOS

### Expected behavior

navigator.geolocation.getCurrentPosition runs in background

### Actual behavior

the entire UI is frozen

### How to reproduce

```js
    navigator.geolocation.getCurrentPosition((pos) => {
      console.log('POS: ' + pos);
    }, (err) => {
      console.log('Geolocation error: ', err);
    }, {enableHighAccuracy: false});
```
atom/browser/api/atom_api_web_contents.cc
content::NavigationHandle* navigation_handle) {
  bool is_main_frame = navigation_handle->IsInMainFrame();
  if (navigation_handle->HasCommitted() && !navigation_handle->IsErrorPage()) {
    auto url = navigation_handle->GetURL();
    bool is_in_page = navigation_handle->IsSamePage();
    if (is_main_frame && !is_in_page) {
      Emit("did-navigate", url);
    } else if (is_in_page) {
      Emit("did-navigate-in-page", url, is_main_frame);
    }
  } else {
    auto url = navigation_handle->GetURL();
    int code = navigation_handle->GetNetErrorCode();
    auto description = net::ErrorToShortString(code);
    Emit("did-fail-provisional-load", code, description, url, is_main_frame);
    
    if (code != net::ERR_ABORTED)
      Emit("did-fail-load", code, description, url, is_main_frame);
  }
}
void WebContents::TitleWasSet(content::NavigationEntry* entry,