Navigator.getGamepads: Document's Permission Policy does not allow calling getGamepads() from this context

Hello everyone.

Our bug tacking system has been showing the following error (1,1M occurances) only happening on FireFox version 9.1.0 desktop:

Navigator.getGamepads: Document’s Permission Policy does not allow calling getGamepads() from this context.

The issue started to appear on the 13th of July 2021

Some information about our front-end architecture is:

  • The error started to occur on the 13th of July,
  • Our app is running within FaceBook,
  • We a download our playcanvas scene which is then deployed,
  • We have our own framework which embeds the pc engine which in turn loads the scene, passed to an application layer which renders it,
  • This approach has been working for us for the last 4-5 years
  • No changes were made to any of our playcanvas code before the error started to occur.

Upon investigating, I found that the only place in our source where this is called, is in the playcanvas engine:

Object.assign(pc, function() {
  var GamePads = function() {
    this.gamepadsSupported = !!navigator.getGamepads || !!navigator.webkitGetGamepads;
    this.current = [];
    this.previous = [];
    this.deadZone = 0.25;
  };

which seems to be initialised upon start. My best guess is that a policy has been changed in FireFox, and hoping someone might have some more insight on this.

The issue is as far as I am aware not blocking the user.

Cheers,
Dave

Do you need to support gamepads?

Just looking at this again and want to double the version number. Firefox is currently on version 90.0 so 9.1.0 is very old :sweat_smile:

Looks like you may be running into this issue? https://marcosc.com/category/uncategorized/page/2/

If you don’t need to support gamepads, then it’s best to disable gamepads in the project settings