- 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.h
v8::Local<v8::Value> RegisterEmbedderCustomElement(
      const base::string16& name, v8::Local<v8::Object> options);
  void RegisterElementResizeCallback(
      int element_instance_id,
      const GuestViewContainer::ResizeCallback& callback);
  void AttachGuest(int element_instance_id);
  void DetachGuest(int element_instance_id);
  
  void SetSpellCheckProvider(mate::Arguments* args,
                             const std::string& language,
                             bool auto_spell_correct_turned_on,
                             v8::Local<v8::Object> provider);
  void RegisterURLSchemeAsSecure(const std::string& scheme);
  void RegisterURLSchemeAsBypassingCSP(const std::string& scheme);
  void RegisterURLSchemeAsPrivileged(const std::string& scheme);
  
  void InsertText(const std::string& text);
  
  void ExecuteJavaScript(const base::string16& code, mate::Arguments* args);
  
  blink::WebCache::ResourceTypeStats GetResourceUsage(v8::Isolate* isolate);
  void ClearCache(v8::Isolate* isolate);
  std::unique_ptr<SpellCheckClient> spell_check_client_;
  blink::WebLocalFrame* web_frame_;
  DISALLOW_COPY_AND_ASSIGN(WebFrame);
};
}  
}  
#endif