Closed marcoscaceres closed 3 years ago
Gamepad events also need protection. We should simply put something like "Events will not be fired unless the feature policy "gamepad" is enabled."
good point! I forgot they fire on the Window object.
I would like to see an issue number that gets closed by this change.
broke a few hundred or thousand games on itch.io
Which browser? As far as I know this change isn't enforced yet in Chrome or Firefox.
Can you link to an example of a game that was broken?
You're right. There's just a warning. So they'll all break in a few months but not today
According to their documentation itch.io hosts web games by embedding an iframe. This is why this change will break a number of games but also means that the fix is simple. itch.io needs to add "gamepad" to the existing allow
attribute in the <iframe>
tags on their pages. They already appear to allow a number of other capabilities through this attribute so it seems that they understand how Permissions Policy works. If I'm correct then this shouldn't require any changes on the part of individual game authors. The change can be made unilaterally by itch.io.
I have contacted the itch.io admin about this via e-mail. If the change is not done in a few days someone else should try pinging him via social media until he notices. He has been responsive about adding needed permissions before so it will likely be done before this is enforced.
Anyone updating mdn?
https://developer.mozilla.org/en-US/docs/Web/HTTP/Feature_Policy
Pinging @jpmedley for the MDN update. This change hasn't shipped in Chrome or Firefox but we've started to show a console warning so a note in MDN would be helpful as well.
Gamepad permission has now been added to itch.io iframe. ✨
I've added an allow="gamepad" attribute to the iframes on https://bitmelo.com however I am still getting this warning in Chrome. Am I handling this correctly or is there something else I need to do?
@byersdz I tried Katana in Chrome 88.0.4324.182 (Official Build) (64-bit) but didn't see any gamepad-related console messages. I checked the source and everything seems fine.
Can you share the text of the console warning?
I saw the message when I loaded https://bitmelo.com, I think I understand the issue and have filed https://crbug.com/1183491 to track the fix.
Is this required yet? When adding the permission to iframes (allow="gamepad") it still prints
Unrecognized feature: 'gamepad'.
But it also still mentions
VM17:1 getGamepad will now require a Permission Policy. Please update your application accordingly. For more information see https://github.com/w3c/gamepad/pull/112
Seen here in console
@subsoap, I believe it should be "coming soon". @JamesHollyer, any update?
Filed WebKit bug https://bugs.webkit.org/show_bug.cgi?id=230136 ... will implement that.
Closes #119
Related: https://github.com/w3c/permissions/pull/200
The following tasks have been completed:
Implementation commitment:
Preview | Diff