Note: it will work only in Chromium Browser (Chrome, Edge, Brave, etc.)
(If you came here just to do simple things, such as changing avatar on keypress, go to point 3)
The game-min.js
file is located on haxball.com/play.
In order to modify it, it needs to be overridden.
- Click green
Code
button →Download ZIP
.
- Extract the .zip file anywhere to an empty folder.
- Do not rename the
www.haxball.com
folder orplay
file inside because they must be overridden!
Set up Local Overrides:
- Navigate to https://www.haxball.com/play.
- Press F12 to open the DevTools panel.
- Open the
Sources
tab. - Open the
Overrides
tab.
- Click
Select folder for overrides
.
- Select the folder with extracted zip – should contain
www.haxball.com
folder. - Click
Allow
to give the browser access to folders.
- This will override game-min.js file.
- Now refresh the page. You should notice some changes (eg.
folder_name=<random string>
on top). - Everything should look like this – check if the directory structure on the right is the same as yours, the
www.haxball.com
folder is crucial: - When you close the browser, and you want to launch Haxball again, just go to Haxball, press F12 to open Dev Tools and refresh the page. The changes should apply. The overrides are preserved after browser restart, so you don't have to set them up again.
- If you want to update, download this repo again (click green
Code
button →Download ZIP
) and replace the old folder with the new one.
REMOVING OVERRIDES:
If you want to remove overrides, click the Ø button next to Enable Local Overrides
option on the above image (if you don't see it, resize the panel).
There are some example scripts in this repo such as: client_bot_utils.js
or flashscore_logger.js
.
They don't actually need overrides and work when client is not modded, although some triggers will be disabled. These files' contents can be just copy-pasted in the console and they'll work.
Snippets allow to save some js files in the browser and run them with one click.
- Press F12 to open the DevTools panel.
- Open the
Sources
tab. - Open the
Snippets
tab.
- Click
New snippet
- New snippet file will appear.
- Paste some code you want to run and click the triangle button below (or press Ctrl+Enter) to run the snippet.
- Snippets are preserved just like the overrides, so you will always have quick access to them.
NOTE: something (if not everything) could break after a Haxball update.