- Electron version: 0.37.2
- Operating system: OS X 10.11.3 

https://github.com/atom/electron/pull/4700 added support for the `visibilitychange` event (thank you @zcbenz!), but that event doesn't make its way into `<webview>`s, which are always "visible" regardless of their host page's `document.visibilityState`.

Tested using the following setup

Host page:

``` coffee
console.log "<webview> host page initial visibilityState =", document.visibilityState

document.addEventListener "visibilitychange", ->
  console.log "<webview> host page visibilitychange event, visibilityState =", document.visibilityState
```

`<webview>`:

``` coffee
console.log "<webview> initial visibilityState =", document.visibilityState

addEventListener "visibilitychange", ->
  console.log "<webview> visibilitychange, visibilityState =", document.visibilityState

setInterval ->
  console.log "<webview> visibilityState =", document.visibilityState
, 3000
```

Host page logs:

```
<webview> host page initial visibilityState = visible
<webview> host page visibilitychange event, visibilityState = hidden
<webview> host page visibilitychange event, visibilityState = visible
```

`<webview>` logs:

```
<webview> initial visibilityState = visible
(24) <webview> visibilityState = visible
```

atom/browser/api/atom_api_web_view_manager.cc
int element_instance_id,
              content::WebContents* embedder,
              content::WebContents* guest_web_contents,
              const base::DictionaryValue& options) {
  auto manager = GetWebViewManager(embedder);
  if (manager)
    manager->AddGuest(guest_instance_id, element_instance_id, embedder,
                      guest_web_contents);
  WebContentsPreferences::FromWebContents(guest_web_contents)->Merge(options);
}
void RemoveGuest(content::WebContents* embedder, int guest_instance_id) {
  auto manager = GetWebViewManager(embedder);
  if (manager)
    manager->RemoveGuest(guest_instance_id);
}
void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
                v8::Local<v8::Context> context, void* priv) {
  mate::Dictionary dict(context->GetIsolate(), exports);
  dict.SetMethod("addGuest", &AddGuest);
  dict.SetMethod("removeGuest", &RemoveGuest);
}
}  
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_web_view_manager, Initialize)