Basuki is a Chrome extension for developer API workflows. It helps you redirect API requests, mock API responses, inspect runtime activity, and open isolated browser sessions from one React/Vite-powered MV3 popup.
- Create, edit, enable/disable, and delete redirect rules.
- Match outgoing request URLs by pattern.
- Replace URL fragments to switch between local, staging, and production APIs.
- Track rule activity from the popup summary.
- Works through the content runtime for
XMLHttpRequest,fetch, and common Axios usage.
- Create mock response rules without changing application code.
- Configure URL pattern, HTTP method, status code, and JSON response body.
- Toggle rules safely from the popup.
- Validate status/body values before saving.
- Use runtime logs to confirm matching behavior.
- Launch isolated browser tabs from the popup.
- Keep session cookies separated for multi-account and multi-environment testing.
- Activate, rename, close, and delete isolated sessions through background runtime actions.
- View normalized session state in the React popup.
- View live redirect/intercept/session summary metrics.
- Review merged popup + runtime logs persisted under
basukiLogs. - Clear popup/runtime logs without deleting rule configuration.
- Export current configuration to JSON.
- Import configuration from JSON with invalid-file handling.
- Copy Status Summary for quick debugging handoff.
- Download the latest release from Releases.
- Unzip the downloaded file.
- Open Chrome and navigate to
chrome://extensions/. - Enable Developer mode.
- Click Load unpacked.
- Select the
distfolder from the release bundle. - Pin or open Basuki from the Chrome toolbar.
git clone https://github.com/zakyyudha/basuki.git
cd basuki
pnpm install
pnpm run build:devThen load the generated dist/ folder from chrome://extensions/.
- Open the Basuki popup.
- Go to the Redirect workflow.
- Create or edit a rule with:
- rule name
- URL pattern to match
- text to replace
- replacement text
- Save the rule.
- Enable it from the rule list.
- Reload the target web page and verify the request is redirected.
Example:
Name: Switch production API to local
URL contains: api.production.com
Replace text: https://api.production.com
With text: http://localhost:3000
- Open the Intercept workflow.
- Create or edit an intercept rule with:
- rule name
- URL pattern
- request method
- HTTP status code
- JSON response body
- Save and enable the rule.
- Trigger a matching request from the target page.
Example:
{
"name": "Mock user missing",
"urlContains": "api.example.com/users/999",
"method": "GET",
"status": 404,
"responseBody": {
"error": "User not found",
"code": "USER_NOT_FOUND"
}
}- Open the Session workflow.
- Enter a session name and origin/URL.
- Launch the isolated tab.
- Use Activate to focus an existing isolated tab.
- Use Rename, Close, or Delete to manage the runtime-backed session.
- Open the Debug workflow.
- Review summary totals and recent logs.
- Use Clear to clear logs only.
- Use Export Config to download a JSON snapshot.
- Use Import Config to restore a valid JSON snapshot.
- Use Copy Status Summary to copy current status/debug context.
Basuki v3 uses a Vite multi-entry build for a Chrome MV3 extension:
basuki/
├── manifest.json # Source MV3 manifest
├── popup.html # Popup HTML shell
├── vite.config.js # Vite multi-entry extension build
├── src/
│ ├── background/ # MV3 service worker and runtime handlers
│ ├── content/ # Content bootstrap and injected intercept runtime
│ └── popup/
│ ├── adapters/ # React-to-Chrome storage/runtime adapters
│ ├── app/ # React popup shell and editors
│ ├── constants/ # Shared popup constants
│ ├── i18n/ # English/Indonesian dictionary and language store
│ ├── state/ # Initial snapshot and storage sync bridge
│ ├── styles/ # React popup CSS
│ └── assets/ # Popup image assets
├── images/ # Extension icons
└── dist/ # Generated extension bundle
# Development build with source maps
pnpm run build:dev
# Production build
pnpm run build
# Watch mode
pnpm run watchThe build emits a loadable extension bundle to dist/ with:
dist/
├── manifest.json
├── popup.html
├── popup.js
├── background.js
├── content.js
├── intercept.js
├── isolation.js
├── chunks/
├── assets/
└── images/
- Make changes under
src/,manifest.json,popup.html, orvite.config.js. - Run
pnpm run build:dev. - Reload Basuki in
chrome://extensions/. - Inspect popup errors with Inspect popup.
- Test redirect/intercept/session/debug workflows against a real page.
- Owns extension lifecycle and MV3 service worker behavior.
- Handles runtime messages from the popup.
- Manages session isolation and cookie operations.
- Updates extension icon state.
- Reads stored redirect/intercept configuration.
- Injects the page interceptor when enabled rules exist.
- Bridges runtime events/logs back into extension storage.
- React UI rendered from
src/popup/app/main.jsx. - Uses adapter modules to preserve Chrome storage/message contracts.
- Synchronizes with
chrome.storage.localthroughsrc/popup/state/syncRuntime.js. - Supports bilingual EN/ID labels from
src/popup/i18n/dictionary.js.
Basuki stores runtime data in chrome.storage.local:
{
apiRedirect: {
configs: []
},
apiIntercept: {
configs: []
},
sessionIsolation: {
isolatedTabs: []
},
basukiLogs: []
}Before shipping changes, run:
pnpm run build:dev
pnpm run buildThen load dist/ in Chrome and verify:
- Redirect create/edit/toggle/delete.
- Intercept create/edit/toggle/delete with JSON body validation.
- Session launch/activate/rename/close/delete.
- Debug summary, logs, clear logs, export/import, and Copy Status Summary.
- Run
pnpm run build. - Load the generated
dist/directory, not the repository root. - Check
chrome://extensions/for manifest errors. - Inspect the popup console for React/runtime errors.
- Confirm the rule is enabled.
- Confirm the URL pattern matches the actual request URL.
- Reload the target page after enabling the rule.
- Open Debug and inspect logs/summary counts.
- Confirm the session was launched from the Session workflow.
- Use Activate to focus the isolated tab.
- Close/delete stale sessions from the popup.
- Reload the extension if Chrome has suspended/restarted the service worker.
- Fork the repository.
- Create a feature branch.
- Make focused changes.
- Run
pnpm run build:devandpnpm run build. - Load
dist/in Chrome and manually verify affected workflows. - Submit a pull request.
ISC License. See LICENSE for details.
- Repository: github.com/zakyyudha/basuki
- Issues: github.com/zakyyudha/basuki/issues
- Releases: github.com/zakyyudha/basuki/releases