DEV Community

Cover image for snakension - a browser extension for playing snake when you're offline
Ovi ren
Ovi ren

Posted on

snakension - a browser extension for playing snake when you're offline

play snake when your internet dies with this extension,

ever lost your internet connection and wished you had something to do? that's what snakension is for. it's a browser extension that gives you the classic snake game right in your browser, and it automatically notifies you to play when you go offline.

snakension preview

what it does

snakension is straightforward. it sits in your browser extensions and lets you play snake whenever you want. the neat part is that it detects when you lose your internet connection and sends you a notification suggesting you play the game while you wait for your connection to come back.

the extension saves your high score locally, so you can keep track of your best performance. the game itself is clean and responsive with smooth controls.

offline notification

how to install it

since this isn't on the chrome web store yet, you'll need to install it manually. here's how:

  1. download the zip file from the latest release
  2. unzip the file somewhere on your computer
  3. open your browser's extensions page:
    • chrome: chrome://extensions/
    • edge: edge://extensions/
    • brave: brave://extensions/
  4. enable developer mode (usually a toggle in the top right)
  5. click "load unpacked"
  6. select the unzipped snakension folder

that's it. the extension will now appear in your toolbar.

features

  • offline detection that sends notifications when you lose internet
  • saves your high score
  • responsive controls for smooth gameplay
  • clean, simple interface
  • works on chrome, edge, and brave

what makes this different

you might be thinking "i can just play snake in a browser tab." true, but here's why snakension is different:

  • automatic offline detection - it actively notifies you when you go offline, turning a frustrating moment into an opportunity to play
  • always accessible - it's pinned to your browser toolbar, no need to bookmark a site or remember a url
  • works completely offline - unlike web-based games, this doesn't need any internet connection at all once installed
  • no distractions - just the game, no ads, no tracking, no unnecessary features

it's about having something useful built right into your browser that's actually there when you need it.

what's coming next

i'm planning to expand it into a mini arcade with more classic games added over time.
the goal is to make this a go-to offline gaming hub in your browser. contributions are welcome - if you have suggestions for games or want to help build them, open an issue on github.

the tech

it's built with vanilla javascript, html, and css. no frameworks, no dependencies. the game logic is classic snake - you move around collecting food, growing longer, and trying not to crash into yourself or the walls.

the background script handles the offline detection by listening to the browser's connection status. when it detects you've gone offline, it triggers a notification that opens the game.

open source

the whole thing is open source under the mit license. you can check out the code, fork it, modify it, or contribute on github.

if you're interested in building browser extensions or just want a simple game to play when your internet drops, give it a try.

visit the project page

Top comments (1)

Collapse
 
francistrdev profile image
👾 FrancisTRᴅᴇᴠ 👾

This looks pretty great! Nice Work!