- Electron version: 1.4.1
- Operating system: -

RegisterURLSchemeAsPrivileged sets the scheme's policies to:
- Secure
- Bypassing CSP
- Allowing Service Workers
- Supporting Fetch API
- CORS Enabled

I want all of those except Bypassing CSP. (Correct me if I'm wrong: Bypassing CSP means I couldn't enforce, say, 'object-src none', because that scheme would bypass the object-src policy. If I'm wrong, please LMK -- this may be a non-issue.)

Could we add an options argument to RegisterURLSchemeAsPrivileged for configuring which is enabled? Something like:

``` js
webFrame.registerURLSchemeAsPrivileged('foo', {
  secure: true,
  bypassCSP: false,
  allowServiceWorkers: true,
  supportFetchAPI: true,
  corsEnabled: true
})
```

For backwards compatibility, the flags would default to `true`, so my usecase would be:

``` js
webFrame.registerURLSchemeAsPrivileged('foo', { bypassCSP: false })
```

If 👍 , I'm happy to write a PR.

atom/renderer/api/atom_api_web_frame.cc
return mate::CreateHandle(isolate, new WebFrame(isolate));
}
blink::WebCache::ResourceTypeStats WebFrame::GetResourceUsage(
    v8::Isolate* isolate) {
  blink::WebCache::ResourceTypeStats stats;
  blink::WebCache::getResourceTypeStats(&stats);
  return stats;
}
void WebFrame::ClearCache(v8::Isolate* isolate) {
  isolate->IdleNotificationDeadline(0.5);
  blink::WebCache::clear();
  base::MemoryPressureListener::NotifyMemoryPressure(
    base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL);
}
void WebFrame::BuildPrototype(
    v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
  prototype->SetClassName(mate::StringToV8(isolate, "WebFrame"));
  mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
      .SetMethod("setName", &WebFrame::SetName)
      .SetMethod("setZoomLevel", &WebFrame::SetZoomLevel)
      .SetMethod("getZoomLevel", &WebFrame::GetZoomLevel)
      .SetMethod("setZoomFactor", &WebFrame::SetZoomFactor)
      .SetMethod("getZoomFactor", &WebFrame::GetZoomFactor)
      .SetMethod("setZoomLevelLimits", &WebFrame::SetZoomLevelLimits)
      .SetMethod("registerEmbedderCustomElement",
                 &WebFrame::RegisterEmbedderCustomElement)