Issue metadata
Sign in to add a comment
|
Gamepad APIs not working in Chrome apps
Reported by
brycetho...@gmail.com,
Mar 7 2017
|
||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; CrOS armv7l 9000.91.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.110 Safari/537.36 Platform: 9000.91.0 (Official Build) stable-channel veyron_minnie Steps to reproduce the problem: 1. Unzip attached file 2. Load app through chrome://extensions page 3. run extension with gamepad connected (you may have to press button to get it to register) What is the expected behavior? Window background should change from red to green when a gamepad is detected. What went wrong? On latest version of chrome no gamepads display in list of gamepads. They do display on the web. Either load index.html on local webserver, or just visit http://html5gamepad.com to verify. Did this work before? Yes 55.0.2862.0, base position 418812 Does this work in other browsers? N/A Chrome version: 56.0.2924.110 Channel: stable OS Version: 9000.91.0 Flash Version: Shockwave Flash 24.0 r0 The breaking change happened somewhere between base position 418812 and 418816. I verified those base positions on mac and windows. (It's a pain to test in chromium OS directly, but issue seems unrelated to a specific platform)
,
Mar 13 2017
Best guess: https://chromium.googlesource.com/chromium/src/+/9f6cd0eb83b8d3166071dd5d5780b688034e0a61 It is the only commit in that range that touches gamepad related code. I looked at the diffs, but I don't understand the function call changes well enough to submit a patch myself.
,
Mar 21 2017
Thanks for narrowing down the regression range. I'll try to repro.
,
Mar 21 2017
,
Mar 21 2017
Just to confirm (since it wasn't clear to me), it works fine as a plain page (i.e. using the repro via `python -m SimpleHTTPServer`, but fails when loaded as an extension). I can repro per #c0 in 59.0.3046.0 (Official Build) canary (64-bit).
,
Mar 21 2017
yukishiino@, would you be able to investigate based on https://codereview.chromium.org/2341723002?
,
Mar 21 2017
#5 - That is correct.
,
Mar 21 2017
I'm wondering if that bisect is a bit misleading now. It changed behaviour so that the unconnected gamepads are "null" rather than "undefined", but in the extension case it just doesn't show up. I'll try to bisect with a modified repro that checks for any truthy Gamepad object showing up instead. (I don't recall if the spec specifies if we must have undefined or null there, but that's sort of separate from this issue.)
,
Mar 21 2017
I got this bisect You are probably looking for a change made after 404931 (known good), but no later than 404965 (first known bad). CHANGELOG URL: https://chromium.googlesource.com/chromium/src/+log/8373bd3fbd078372e714edd73ab95a23b1d1d603..254dc66bc04a9eeef14440dfc7fe79b8cc9ec2a5 using setInterval(() => { var gamepads = navigator.getGamepads(); console.log(gamepads) if(gamepads[0] || gamepads[1] || gamepads[2] || gamepads[3]){ document.getElementsByTagName("body")[0].style.backgroundColor = "green"; } }, 30); instead. But I don't see a CL that looks promising there. Hmm.
,
Mar 21 2017
I did a commit level git bisect and landed on [f18ffeb...]c:\src\cr2\src>git bisect bad f18ffebd279ad21196d988f763313e4a460db316 is the first bad commit commit f18ffebd279ad21196d988f763313e4a460db316 Author: haraken <haraken@chromium.org> Date: Tue Jul 12 20:28:34 2016 -0700 Remove DOMWindowProperty::willDetachGlobalObjectFromFrame DOMWindowProperty::willDetachGlobalObjectFromFrame is dispatched at the same timing as ContextLifecycleObserver::contextDestroyed (via Document::detach). Hence this CL replaces DOMWindowProperty::willDetachGlobalObjectFromFrame with ContextLifecycleObserver::contextDestroyed. BUG=610176 Review-Url: https://codereview.chromium.org/2138003002 Cr-Commit-Position: refs/heads/master@{#404961} :040000 040000 c85dca6812f180beded7719df5aa79bdc49ce7a6 f48e13db6a89a80c9ff354245ec1d3099d84680f M third_party [f18ffeb...]c:\src\cr2\src>git bisect log git bisect start # good: [8373bd3fbd078372e714edd73ab95a23b1d1d603] Removed histogram merge code that is no longer actively used. git bisect good 8373bd3fbd078372e714edd73ab95a23b1d1d603 # bad: [254dc66bc04a9eeef14440dfc7fe79b8cc9ec2a5] Auto-rebaseline for r404891 git bisect bad 254dc66bc04a9eeef14440dfc7fe79b8cc9ec2a5 # good: [bdbc56ba8839e6bb32a3677bf199234641f36806] [Remoting Android] Fix GetWeakPtr() calls on multiple threads git bisect good bdbc56ba8839e6bb32a3677bf199234641f36806 # good: [59d3718ac1328d46fac147720f078c53f63070cf] Implement use_cfi_cast to optionally enable cast checks. git bisect good 59d3718ac1328d46fac147720f078c53f63070cf # good: [b7f49840eb4c80f98c30e599fb39ae1a41a6eefc] Show empty bell icon in notification button initially git bisect good b7f49840eb4c80f98c30e599fb39ae1a41a6eefc # bad: [6aa36b6c741ab188448a6673c393af135ee6572e] Implement SignedCertificateTimestamp::isolatedCopy git bisect bad 6aa36b6c741ab188448a6673c393af135ee6572e # bad: [f18ffebd279ad21196d988f763313e4a460db316] Remove DOMWindowProperty::willDetachGlobalObjectFromFrame git bisect bad f18ffebd279ad21196d988f763313e4a460db316 # first bad commit: [f18ffebd279ad21196d988f763313e4a460db316] Remove DOMWindowProperty::willDetachGlobalObjectFromFrame I guess this indicates some change in lifetime of the gamepad object that somehow only affects extensions/apps. haraken, do you understand what's happening here?
,
Mar 22 2017
re #8: Just FYI (not related to this issue itself), https://w3c.github.io/gamepad/#navigator-interface-extension sequence<Gamepad?> getGamepads(); where "Gamepad?" means an Object of interface Gamepad or null. "?" stands for "nullable" (https://heycam.github.io/webidl/#idl-nullable-type).
,
Apr 13 2017
Just filed bug 711252 which may be related: it's not to do with Chrome apps, it's that gamepad input doesn't work at the top level in popup windows. In other words gamepad input only works when the full tabbed browser UI is showing, or if it's in an iframe.
,
Apr 27 2017
|
|||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||
Comment 1 by brycetho...@gmail.com
, Mar 13 2017