A proxy for Browservice that makes it interactive on devices without cursor support through the arrow keys, enter, and numpad. Very jankily made for a silly YouTube video, but hey, it (kind of) works.
- A Browservice instance running with
--chromium-args=enable-spatial-navigationand the--start-pageoption set to a search engine likehttps://google.com(otherwise it will be non-interactive since you can't reach the address bar) - Bun (not Node.JS)
- A lacking sense of dignity
Firstly, run bun install in order to install dependencies.
Secondly, copy example.env to .env and point BROWSERVICE_URL to the instance that you're running. You can also edit SERVER_PORT if you need to.
Thirdly, run bun run build (not bun build) to generate the JS files that'll get injected into the proxy. Finally, run the server using bun start.
If you open browserviceserviceservice in your browser, you should get the regular Browservice UI until about a second later when my extra code loads in. It will automatically focus the page content for you, after which you can travel around using your arrow keys and the enter key. You can also type if you're using a keyboard, but if you have access to a keyboard, you should seriously reconsider using this project. Idiot.
To toggle typing mode, you can press F1. If you're using something else like, I dunno, a smart Blu-Ray player with a universal remote or some weird shit like that, you probably don't have access to this key. For this project, I specifically mapped the typing mode activation key to both F1 and "MediaFastForward" (the fast forward button), since that's the key that the blue button on my remote corresponds to. You can edit this, and any other key combinations, like so:
- Determine which button on your remote/keyboard/input device you want to use, and press it while having browserviceserviceservice open and focused. Take note of the message on the top of the screen that says "pressed" followed by a number (the keycode).
- Go to
src/typing.ts, look at the const near the top of the file calledkeycodeMap, and find the line that says "blue" (or another key). - Replace the default keycode
417with the keycode corresponding to the button you want to use. - Run
bun run buildagain, and restart the server.
If you get "Unable to connect. Is the computer able to access the url?", it means that your .env file is misconfigured, or that your Browservice instance isn't running or isn't reachable. You can potentially fix the latter issue by running Browservice with the option --vice-opt-http-listen-addr=0.0.0.0:8080, because it otherwise might refuse connections if you're trying to reach it from another computer on the same network, which is an issue I had myself since I'm using macOS and Browservice doesn't have a build available for that.
If you get any other errors or issues, either start praying, or send me an email (it's on my YouTube channel if you click on the description below the channel name). I'd love to help!