How warmachine7733/interceptor-extension works
API Mock is a local Chromium extension for configuring request mocks and replaying or recording API flows. The main path is user-edited rules and flows in Options, saved in local browser storage, delivered by the bridge to page scripts, then matched against fetch/XHR requests to mock, override, or pass them through. Recording captures feed back into saved flows. The sampled sources show key storage, messaging, and matching links; some UI and interception details are documented in the README but not fully excerpted.
Main entry points: bridge.js Content Bridge · page-interceptor.js Request Interceptor · options.js Options UI · background.js Background Worker
Components 15
Configuration UI
- Options UI
options.js - Rule Editing
options-utils.js - Flow Editor
options.js
Page Runtime
- Content Bridge
bridge.js - Rule Matcher
rules.js - Request Interceptor
page-interceptor.js - Mock / Override
page-interceptor.js - Stylesheet Rules
bridge.js
Flow Recording
- Flow Capture
page-interceptor.js - Sequential Replay
rules.js - Page Indicator
recording-indicator.js
Local State
- Local Settings
- Background Worker
background.js
Other components
- Developer
- Page Requests
Connections 18
- Developer → Options UI: opens settings
README.md - Options UI → Rule Editing: uses editing helpers
- Options UI → Flow Editor: edits flows
options.js - Options UI → Local Settings: reads and saves
options.js - Background Worker → Options UI: opens page
background.js - Background Worker → Local Settings: stores captures
background.js - Content Bridge → Local Settings: reads configuration
bridge.js - Content Bridge → Request Interceptor: posts configuration
bridge.js - Request Interceptor → Rule Matcher: uses matching functions
page-interceptor.js - Page Requests → Request Interceptor: intercepted by
README.md - Request Interceptor → Mock / Override: mocks or rewrites
README.md - Request Interceptor → Flow Capture: captures requests
page-interceptor.js - Request Interceptor → Sequential Replay: matches replay steps
page-interceptor.js - Flow Capture → Content Bridge: forwards captures
bridge.js - Content Bridge → Background Worker: sends capture message
bridge.js - Content Bridge → Stylesheet Rules: applies stylesheet rules
bridge.js - Content Bridge → Page Indicator: broadcasts configuration
recording-indicator.js - Sequential Replay → Mock / Override: supplies flow response