- Electron version: 0.37.6
- Operating system: OS X

As of https://github.com/electron/electron/issues/2687, unknown schemes are automatically opened in an external app. There appears to be no way to prevent this behavior or prompt the user for permission before the external app is opened.

One way to solve this would be to allow wildcards in `protocol.registerXXXProtocol`; then the Electron app can do whatever checks it wants before calling `shell.openExternal` on the URL.

atom/browser/web_contents_permission_helper.cc
const base::Callback<void(bool)>& callback) {
  RequestPermission((content::PermissionType)(PermissionType::FULLSCREEN),
                    callback);
}
void WebContentsPermissionHelper::RequestMediaAccessPermission(
    const content::MediaStreamRequest& request,
    const content::MediaResponseCallback& response_callback) {
  auto callback = base::Bind(&MediaAccessAllowed, request, response_callback);
  
  
  RequestPermission(content::PermissionType::AUDIO_CAPTURE, callback);
}
void WebContentsPermissionHelper::RequestWebNotificationPermission(
    const base::Callback<void(bool)>& callback) {
  RequestPermission(content::PermissionType::NOTIFICATIONS, callback);
}
void WebContentsPermissionHelper::RequestPointerLockPermission(
    bool user_gesture) {
  RequestPermission((content::PermissionType)(PermissionType::POINTER_LOCK),
                    base::Bind(&OnPointerLockResponse, web_contents_),
                    user_gesture);
}
}