Firefox 浏览器附加组件
  • 扩展
  • 主题
    • 适用于 Firefox
    • 字典和语言包
    • 其他浏览器网站
    • 适用于 Android 的附加组件
登录
Moq - Mock API Requests 预览

Moq - Mock API Requests 作者: Pavel Shpakovich

Mock HTTP requests with custom responses, status codes, delays, and headers. Perfect for development, testing, and debugging.

0(0 条评价)0(0 条评价)
下载 Firefox 并安装扩展
下载文件

扩展元数据

屏幕截图
关于此扩展
Moq - Powerful API Mocking for Chrome DevTools

Moq is a developer tool that intercepts and mocks HTTP requests directly in your browser, eliminating the need to modify backend code or wait for API changes during frontend development.

WHY INSTALL MOQ?

✓ Speed Up Development - Test different API responses instantly without backend changes or server restarts
✓ Isolated Testing - Work offline or test edge cases (errors, timeouts, specific data) that are hard to reproduce
✓ No Code Changes - Mock requests at the browser level without touching your application code
✓ Real Time Control - Enable/disable mocks on-the-fly, perfect for comparing real vs mocked responses

KEY FEATURES

→ Client-Side Interception
Captures fetch() and XMLHttpRequest before they reach the network

→ Full Response Control
Set custom status codes (200, 404, 500), response bodies, headers, and delays

→ Proxy Rules
Route matching requests through a custom proxy target instead of returning a mock response
• Redirect requests to any base URL (e.g. staging, local server)
• Optional path rewrite with from/to pattern (plain string or regex)
• Attach JavaScript response hooks to transform proxied responses
• Conflict detection warns when a proxy rule overlaps with a mock rule
• Hit counters track how many times each proxy rule is triggered
• Import/Export proxy rules independently from mock rules

→ Response Hooks with JavaScript
Write code to transform responses dynamically (both mock and real)
• Toggle hooks on/off without deleting code
• Comprehensive validation catches undefined variables and syntax errors
• Available globals: response, request, helpers (uuid, timestamp, random data)

→ Two Response Modes
• Mock Mode - Return configured mock response with your custom data
• Passthrough Mode - Forward request to real server and transform response with JavaScript hook

→ Dynamic Variables
Generate unique data with {{timestamp}}, {{uuid}}, {{random_number}}, {{random_string}} in responses

→ Request Recording & Logging
Record and inspect actual network traffic, create mocks from real responses with one click

→ Smart Organization
Group rules into folders, search and filter, bulk enable/disable, hit counters show usage
• Compact and detailed view modes for both Rules and Proxy tabs

→ Rule Validation & Warnings
Automatic detection of invalid regex, JSON errors, overlapping rules, and unused rules

→ Import/Export with Preview
Share rule configurations with merge or replace modes, validate before importing

→ Multi-Monitor Support
Open in standalone window or DevTools panel, full state synchronization

→ Dark/Light Theme
System preference detection with manual override

→ CORS Auto-Fix
Automatically inject CORS headers to bypass cross-origin restrictions

→ Multi-Language
Full English and Russian translations

USE CASES & BENEFITS

FOR FRONTEND DEVELOPERS:
• Test different API responses without backend changes
• Redirect API calls to a local or staging server with Proxy Rules
• Work offline or before backend APIs are ready
• Validate error handling with custom error responses
• Test loading states with configurable delays

FOR QA ENGINEERS:
• Simulate edge cases that are hard to reproduce
• Test timeout scenarios and network failures
• Validate UI with specific data combinations
• Automate testing with exported rule configurations

FOR DEBUGGING:
• Modify production API responses locally for troubleshooting
• Proxy requests to a different environment without changing application code
• Compare real vs mocked responses side-by-side
• Track request/response patterns with hit counters
• Organize test scenarios into folders for different features

PRIVACY & SECURITY

✓ No data collection
✓ No external servers
✓ All data stored locally in your browser
✓ Open source and transparent

GETTING STARTED
  1. Open Chrome DevTools (F12)
  2. Click the "Moq" tab
  3. Create your first mock rule with URL pattern matching
  4. Enable recording to capture real requests
  5. Click "Mock This" on any logged request to create a rule instantly
  6. Use Proxy Rules to redirect requests to a different server without changing your code

Perfect for frontend developers, QA engineers, and anyone who needs to test API integrations without modifying backend code or waiting for server changes. All data stays local - no external servers, no data collection, complete privacy.
评分 0(1 位用户)
登录以评价此扩展
目前尚无评分

已保存星级评分

5
0
4
0
3
0
2
0
1
0
尚无评价
权限与数据

必要权限:

  • 拦截任何页面上的内容
  • 让开发者工具可以存取您打开的标签页中的数据
  • 获取浏览器标签页
  • 访问您在所有网站的数据

可选权限:

  • 访问您在所有网站的数据

收集的数据:

  • 开发者称此扩展无需收集数据。
详细了解
更多信息
附加组件链接
  • 用户支持网站
  • 支持邮箱
版本
2.15.1
大小
391.95 KB
上次更新
2 小时前 (2026年3月12日)
相关分类
  • 网页开发
许可证
Mozilla 公共许可证 2.0
隐私政策
阅读此附加组件的隐私政策
版本历史
  • 查看所有版本
添加到收藏集
举报此附加组件
转至 Mozilla 主页

附加组件

  • 关于
  • Firefox 附加组件博客
  • 扩展工坊
  • 开发者中心
  • 开发者政策
  • 社区博客
  • 论坛
  • 报告缺陷
  • 评价指南

浏览器

  • Desktop
  • Mobile
  • Enterprise

产品

  • Browsers
  • VPN
  • Relay
  • Monitor
  • Pocket
  • Bluesky (@firefox.com)
  • Instagram (Firefox)
  • YouTube (firefoxchannel)
  • 隐私
  • Cookie
  • 法律

除非另有注明,否则本网站上的内容可按知识共享 署名-相同方式共享 3.0 或更新版本使用。