- 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
#include "atom/renderer/api/atom_api_web_frame.h"
#include "atom/common/api/event_emitter_caller.h"
#include "atom/common/native_mate_converters/blink_converter.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/gfx_converter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "atom/renderer/api/atom_api_spell_check_client.h"
#include "base/memory/memory_pressure_listener.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_view.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
#include "third_party/WebKit/public/web/WebCache.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebScriptExecutionCallback.h"
#include "third_party/WebKit/public/web/WebScriptSource.h"
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "atom/common/node_includes.h"
namespace atom {
namespace api {
namespace {
class ScriptExecutionCallback : public blink::WebScriptExecutionCallback {