Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Just like few others here, I wanted keyboard shortcuts so I just hacked it quickly. Will break if DOM classes change, but author should implement something better.

Cool game.

```

const rotate = (direction) => { const directions = {counterclockwise: 0, clockwise: 1}; const buttons = Array.from(document.querySelector('.mt-16.flex.items-center.justify-between.w-72.h-12.px-2').querySelectorAll('div')).filter(el => el.className === ''); buttons[directions[direction]].click(); }

document.addEventListener('keydown', (ev) => { switch (ev.key) { case 'ArrowLeft': rotate('counterclockwise'); break; case 'ArrowRight': rotate('clockwise'); break; } });

```



Thanks a lot! I just added the keyboard shortcuts :)


It is neat that the modern browser, for all its flaws, is so easily hackable




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: