Mock:Intercept and directly return data

拦截请求并直接返回 Mock 数据,包括 XMLHttpRequest、fetch类接口
What is Mock:Intercept and directly return data?
"Mock:Intercept and directly return data" is a Chrome extension designed to intercept HTTP requests and directly return configured mock data, streamlining development and testing processes. It supports XMLHttpRequest and fetch, automatically generates mock data from Swagger 2.0 documentation, and accommodates GraphQL requests. Featuring multiple matching modes, configurable response delays, and support for import/export of configurations, it also offers type definitions for TypeScript. The extension operates in both English and Chinese based on the browser's language settings.

Extension stats

Users: 1,000+
Rating: 4.83 (6)
Version: 1.5.4 (Last updated: 2024-11-15)
Creation date: 2023-06-20
Risk impact: Moderate risk impact
Risk likelihood: Moderate risk likelihood
Manifest version: 3
Permissions:
  • storage
  • declarativeNetRequest
Host permissions:
  • http://*/*
  • https://*/*
Size: 498.69K

Other platforms

Not available on Firefox
Not available on Edge
Want to check extension ranking and stats more quickly for other Chrome extensions? Install Chrome-Stats extension to view Chrome-Stats data as you browse the Chrome Web Store.

Extension summary

这是一款拦截对应请求并直接返回配置数据的 Mock 工具。它能帮助我们在开发过程中,减少对接口的依赖,尽可能保证我们能及更加清晰的逻辑来开发或者测试代码。

具体以下功能:

  1. 支持拦截和模拟使用 XMLHttpRequest 或 fetch 方法来请求的接口。
  2. 根据 swagger2.0 文档自动生成 Mock 数据。
  3. 支持 GraphQL 请求的 Mock。
  4. 允许对匹配的接口进行 Redirect 操作。
  5. 提供 contains、equals 和 regexp 三种匹配模式,以满足不同的接口匹配需求。
  6. 成功拦截匹配的接口,直接返回对应的 Mock 数据,无需进行实际的网络请求,Mock 时就不用等待接口返回 200 后才能继续进行后面的操作。
  7. 可以设置延迟返回时间,以模拟真实接口的响应。
  8. 支持导入、导出配置数据。
  9. 支持中英文两种语言。根据浏览器语言环境,自动显示对应的语言。
  10. 增加 mock 数据转 TypeScript 类型定义。

User reviews

好用,只是数据太大了后不支持,然后不支持mock file等,希望有后续支持。
by Loff Fred, 2024-11-06

by yang jin, 2024-10-17

I give 4 because, this extension able to do redirect to another url too.
View all user reviews

Extension safety

Risk impact

Mock:Intercept and directly return data requires a few sensitive permissions. Exercise caution before installing.

Risk likelihood

Mock:Intercept and directly return data is probably trust-worthy. Prefer other publishers if available. Exercise caution when installing this extension.

Upgrade to see risk analysis details

Promo images

Mock:Intercept and directly return data small promo image
Small promo image

Similar extensions

Here are some Chrome extensions that are similar to Mock:Intercept and directly return data: