Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
andrew-git opened this issue Nov 30, 2023 · 0 comments · Fixed by #1728

Comments

@andrew-git
Copy link
Contributor

andrew-git commented Nov 30, 2023

Latest Chrome Instant games gives issue:
Failed to execute 'getGamepads' on 'Navigator': Access to the feature "gamepad" is disallowed by permissions policy.

Possible fix in src/lime/ui/Joystick.hx

	#if (js && html5)
	@:noCompletion private static function __getDeviceData():Array<Dynamic>
	{
		var res:Dynamic = null;
		
		try 
		{
			res = (untyped navigator.getGamepads) ? untyped navigator.getGamepads() : (untyped navigator.webkitGetGamepads) ? untyped navigator.webkitGetGamepads() : null;
		}
		catch (err:Dynamic)
		{
			trace("Gamepad access issue");
		}
		
		return res;
	}
	#end

Or maybe also add new flag to prevent call updateGameDevices() each frame in src/lime/_internal/backend/html5/HTML5Application.hx
if we don't need this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant