- 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.h
: public content::WebContentsUserData<WebContentsPermissionHelper> {
 public:
  ~WebContentsPermissionHelper() override;
  enum class PermissionType {
    POINTER_LOCK = static_cast<int>(content::PermissionType::NUM) + 1,
    FULLSCREEN
  };
  void RequestFullscreenPermission(
      const base::Callback<void(bool)>& callback);
  void RequestMediaAccessPermission(
      const content::MediaStreamRequest& request,
      const content::MediaResponseCallback& callback);
  void RequestWebNotificationPermission(
      const base::Callback<void(bool)>& callback);
  void RequestPointerLockPermission(bool user_gesture);
 private:
  explicit WebContentsPermissionHelper(content::WebContents* web_contents);
  friend class content::WebContentsUserData<WebContentsPermissionHelper>;
  void RequestPermission(
      content::PermissionType permission,
      const base::Callback<void(bool)>& callback,
      bool user_gesture = false);
  content::WebContents* web_contents_;
  DISALLOW_COPY_AND_ASSIGN(WebContentsPermissionHelper);
};
}  
#endif