DOMException: Failed to execute 'getGamepads' on 'Navigator': Access to the feature "gamepad" is disallowed by permissions policy.
12

We are randomly getting this error while loading the game

DOMException: Failed to execute 'getGamepads' on 'Navigator': Access to the feature "gamepad" is disallowed by permissions policy.

Issue is happening only on Facebook. Facebook seems to be adding gamepad=() in Permissions-Policy which breaks the game.

This seems to be happening with many other games on Facebook. Has anyone found any fix or workaround for this issue?

Gaurang
تم طرح السؤال منذ حوالي ‏١٠‏ أشهر
Alexey

we have the same problem. occurs more often in Chrome. it started suddenly about 12 hours ago without any action on our part.

if we clean the cache, the game will start once, but after rebooting, the error will appear again

‏٥ ديسمبر‏‏١:١٩ ص‏111
الإجابة المحددة
1

We're facing the same issue

‏٦ ديسمبر‏‏٧:٣٣ ص‏111
Markus
2

we have also get this error

‏٥ ديسمبر‏‏٦:٢٠ ص‏111
Abdul
2

Same here

‏٥ ديسمبر‏‏١٠:٢٥ ص‏111
Illia
2

We are facing same issue in our game.

‏٥ ديسمبر‏‏٨:١١ م‏111
Sujeet
7

in our case (unity webgl game) this workaround worked for us: navigator.getGamepads = null;

‏٥ ديسمبر‏‏٢:٢٤ م‏111
Diego
Abdul

can you share the file or tell us where to add this

‏٥ ديسمبر‏‏٨:٢٦ م‏111
Diego

this line of javascript code need to be executed before the file which is causing the error be loaded

‏٥ ديسمبر‏‏٩:١٣ م‏111
Sujeet

We did this change in javascript file which loads Unity and its working now. Thanks for the workaround.

‏٥ ديسمبر‏‏١٠:٢٧ م‏111
Illia

It is working for us, thank you!

‏٦ ديسمبر‏‏١٢:٣٨ ص‏111
Vitalii

Yeah, it is working, thank you

‏٦ ديسمبر‏‏١:٢٢ ص‏111
Hugo

work!

‏٦ ديسمبر‏‏٤:٤٠ ص‏111
Min

Thank you for your sharing!

‏٦ ديسمبر‏‏٦:٤١ م‏111