Disturb-AI helps you stay mindful of distractions while working online. It lets you set a focus goal, detects distracting browsing behavior and alerts you when your focus strays too long.
- Clone this repository.
- Run
npm installto install dependencies. - During development, use
npm run devand load thesrcfolder as an unpacked extension. - For production, run
npm run buildto generate the extension in thedist/folder. - Load the
distfolder as an unpacked extension in Chrome. - Provide your OpenAI API key on the settings page to enable distraction detection.
- Saved options and focus goals are automatically loaded the next time you open the popup or options page.
- Optionally add your own extension icons under
src/iconsand reference them inmanifest.json.
The source under src/ contains a minimal working skeleton. Edit the scripts to add advanced distraction detection logic.
If you'd like to recreate this extension completely from scratch, follow these basic steps. They mirror how this repository was initialized.
- Initialise a new Node project:
npm init -y
- Install React, Vite and the React plugin for Vite:
npm install -D vite @vitejs/plugin-react react react-dom
- Create a
src/directory and within it addpopup.htmlandoptions.html. - Create React entry points (e.g.
popup-main.jsxandoptions-main.jsx) that mount your React components. - Write a minimal
manifest.jsonreferencing your HTML files and a background service worker script. - Add a
vite.config.js(see this repo for reference) so thatnpm run devandnpm run buildwork correctly. - Update
package.jsonscripts to includedev,buildand optionallytestcommands.
A simple GitHub Actions workflow installs dependencies and runs npm test on pull requests.
Placeholder license text.