[Webkit-unassigned] [Bug 205448] New: navigator.getGamepads() returns empty array in WKWebView

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 19 07:03:47 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=205448

            Bug ID: 205448
           Summary: navigator.getGamepads() returns empty array in
                    WKWebView
           Product: WebKit
           Version: Safari 13
          Hardware: iPhone / iPad
                OS: iOS 13
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: iain at scirra.com

It's currently not possible to use the GamePad API within a hybrid application. Using the navigator.getGamePads() method in a WKWebview returns an empty array when a gamepad is attached, even after user interaction. Whereas Safari on the same device will return an array containing a Gamepad instance after user interaction.

I tried adding the Wireless Accessory Configuration capability to the application, but it had no effect. This was the only plausible sounding capability in the list.

Replication:
1. Connect gamepad to iOS device using bluetooth ( Dualshock 4 controllers are easy to setup )
2. Load http://luser.github.io/gamepadtest/
3. Press any button on the device ( required to "wakeup" the API )

Expected result:
Page displays controller status

Actual result:
Nothing happens

For a more minimal test you can call navigator.getGamePads() from the console and inspect the results.

Application was built in Xcode 11.3 (11C29) targeting iOS 12.0 and tested on iPad Pro ( ML0H2ZP/A ) on iPadOS 13.2.3 (17B111) with Sony DS4 ( CUH-ZCT1E ).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20191219/217212f8/attachment.htm>


More information about the webkit-unassigned mailing list