Source code

Revision control

Copy as Markdown

Other Tools

/* Any copyright is dedicated to the Public Domain.
var GamepadService;
async function setGamepadPreferenceAndCreateIframe(iframeSrc) {
await SpecialPowers.pushPrefEnv({
set: [["dom.gamepad.test.enabled", true]],
});
let iframe = document.createElement("iframe");
iframe.src = iframeSrc;
document.body.appendChild(iframe);
}
function runGamepadTest(callback) {
GamepadService = navigator.requestGamepadServiceTest();
callback();
}