I have landed an article over on web.dev that talks about the Gamepad API. One piece of information from this article that our editorial board was not comfortable with having in there was instructions on how to play the Chrome dino game on a Nintendo Switch. So, here you go with the steps right here on my private blog instead.
The Nintendo Switch contains a hidden browser, which serves for logging in to Wi-Fi networks behind a captive portal. The browser is pretty barebones and does not have a URL bar, but, once you have navigated to a page, it is fully usable. When doing a connection test in system settings, the Switch will detect that the captive portal is present and display an error for it when the response for http://conntest.nintendowifi.net/ does not include the
X-Organization: Nintendo HTTP header. I can make creative use of this by pointing the Switch to a DNS server that simulates a captive portal that then redirects to a search engine.
- Go to System Settings and then Internet Settings and find the Wi-Fi network that your Switch is connected to. Tap Change Settings.
- Find the section with the DNS Settings and add 184.108.40.206 as a new Primary DNS. Note that this DNS server is not operated by me but a third-party, so proceed at your own risk.
- Save the settings and then tap Connect to This Network.
- The Switch will tell you that Registration is required to use this network. Tap Next.
- On the page that opens, make your way to Google.
- Search for “chrome dino tomayac”. This should lead you to https://github.com/tomayac/chrome-dino-gamepad.
- On the right-hand side in the About section, find the link to https://tomayac.github.io/chrome-dino-gamepad/. Enjoy!
- 🚨 For regular Switch online services to work again, turn your DNS settings back to Automatic. Conveniently, the Switch remembers previous manual DNS settings, so you can easily toggle between Automatic and Manual.
For the Chrome dino gamepad demo to work, I have ripped out the Chrome dino game from the core Chromium project (updating an earlier effort by Arnelle Ballane), placed it on a standalone site, extended the existing gamepad API implementation by adding ducking and vibration effects, created a full screen mode, and Mehul Satardekar contributed a dark mode implementation. Happy gaming!
You can also play Chrome dino with your gamepad on this very site. The source code is available on GitHub. Check out the gamepad polling implementation in
trex-runner.js and note how it is emulating key presses.
Article source :=> Read More