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 developed by xiangmingcsyr, and its main feature is "拦截请求并直接返回 Mock 数据,包括 XMLHttpRequest、fetch类接口".

Extension Screenshots

screenshot
screenshot
screenshot
screenshot

Download Mock:Intercept and directly return data Extension CRX File

Download Mock:Intercept and directly return data extension files in crx format, manually install Chrome extensions in the browser, or share the crx files with friends to easily install Chrome extensions.

Extension Usage Instructions

                        这是一款拦截对应请求并直接返回配置数据的 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. 支持一键重置。
11. 支持对 Mock 的配置进行 Clone。
12. 支持 Mock 列表分组。                    

Extension Basic Information

Name Mock:Intercept and directly return data Mock:Intercept and directly return data
ID kmphamhphplpcjcabjdjjklfjmgkmpba
Official URL https://chromewebstore.google.com/detail/mockintercept-and-directl/kmphamhphplpcjcabjdjjklfjmgkmpba
Description 拦截请求并直接返回 Mock 数据,包括 XMLHttpRequest、fetch类接口
File Size 472 KB
Installation Count 621
Current Version 1.3.2
Last Updated 2023-11-29
Publish Date 2023-06-20
Rating 4.75/5 Total 4 Ratings
Developer xiangmingcsyr
Email [email protected]
Payment Type free
Help Page URL https://juejin.cn/post/7252524782238908474
Supported Languages zh-CN
manifest.json
{
    "update_url": "https:\/\/clients2.google.com\/service\/update2\/crx",
    "name": "Mock:Intercept and directly return data",
    "version": "1.3.2",
    "description": "\u62e6\u622a\u8bf7\u6c42\u5e76\u76f4\u63a5\u8fd4\u56de Mock \u6570\u636e\uff0c\u5305\u62ec XMLHttpRequest\u3001fetch\u7c7b\u63a5\u53e3",
    "manifest_version": 3,
    "options_page": "options\/index.html",
    "icons": {
        "16": "images\/icon.png",
        "32": "images\/icon.png",
        "48": "images\/icon.png",
        "128": "images\/icon.png"
    },
    "action": {
        "default_icon": {
            "16": "images\/icon.png",
            "32": "images\/icon.png",
            "48": "images\/icon.png",
            "128": "images\/icon.png"
        },
        "default_title": "swagger mock \u63d2\u4ef6"
    },
    "background": {
        "service_worker": "scripts\/background.js",
        "type": "module"
    },
    "permissions": [
        "storage",
        "declarativeNetRequest"
    ],
    "host_permissions": [
        "http:\/\/*\/*",
        "https:\/\/*\/*"
    ],
    "content_scripts": [
        {
            "js": [
                "scripts\/content.js"
            ],
            "matches": [
                ""
            ],
            "run_at": "document_start",
            "all_frames": true
        }
    ],
    "web_accessible_resources": [
        {
            "resources": [
                "scripts\/overrideRequest.js"
            ],
            "matches": [
                ""
            ]
        }
    ],
    "commands": {
        "_execute_action": {
            "suggested_key": {
                "windows": "Ctrl+M",
                "mac": "Command+M",
                "chromeos": "Ctrl+M",
                "linux": "Ctrl+M"
            }
        }
    }
}