Browse Source

fix: use disable-hid-blocklist to allow FIDO (#31650)

Co-authored-by: John Kleinschmidt <[email protected]>
trop[bot] 3 years ago
parent
commit
5fdf37eac9
1 changed files with 4 additions and 1 deletions
  1. 4 1
      shell/browser/hid/electron_hid_delegate.cc

+ 4 - 1
shell/browser/hid/electron_hid_delegate.cc

@@ -7,7 +7,9 @@
 #include <string>
 #include <utility>
 
+#include "base/command_line.h"
 #include "content/public/browser/web_contents.h"
+#include "services/device/public/cpp/hid/hid_switches.h"
 #include "shell/browser/hid/hid_chooser_context.h"
 #include "shell/browser/hid/hid_chooser_context_factory.h"
 #include "shell/browser/hid/hid_chooser_controller.h"
@@ -103,7 +105,8 @@ const device::mojom::HidDeviceInfo* ElectronHidDelegate::GetDeviceInfo(
 }
 
 bool ElectronHidDelegate::IsFidoAllowedForOrigin(const url::Origin& origin) {
-  return false;
+  return base::CommandLine::ForCurrentProcess()->HasSwitch(
+      switches::kDisableHidBlocklist);
 }
 
 void ElectronHidDelegate::OnDeviceAdded(