拦截请求并直接返回 Mock 数据,包括 XMLHttpRequest、fetch类接口

Latest Version

Version
1.5.4
Update
November 15, 2024
Size
487KiB
Developer
Category
Users
1,000+
Rating
4.83333 ★
Manifest Version
3
Web Store Status
Languages Support
中文 (简体)
See more
Permissions
Storage
DeclarativeNetRequest
See more

Mock:Intercept and directly return data Extension

这是一款拦截对应请求并直接返回配置数据的 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 类型定义。
Read more

Source Manifest.json

{"update_url": "https://clients2.google.com/service/update2/crx", "name": "Mock:Intercept and directly return data", "version": "1.5.4", "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" } } }}
Read more

How to download and manually install Mock:Intercept and directly return data extension for Chrome

Looking for a way to install Mock:Intercept and directly return data extensions for Chrome, you can search for them in the Chrome Web Store, clicking the "Add to Chrome" button, and following the straightforward process.

However, you may need to install Mock:Intercept and directly return data extensions manually, this article outlines two simple methods to effortlessly install Mock:Intercept and directly return data extensions, whether they come as unpacked folders in compressed formats like .zip or as .crx files.

Method 1: Download Mock:Intercept and directly return data extension and manually install through Drag &Drop

If you ever need to manually install a Mock:Intercept and directly return data extension for Chrome, don't worry, it's a simple process. Just follow these easy steps, and you will have your extension ready to use in no time.

Step 1: Download the Mock:Intercept and directly return data Extension by clicking the "Download CRX" button on the website.

Look for the Mock:Intercept and directly return data extension you wish to install. Go to the website and download the Mock:Intercept and directly return data extension package, which is usually a .CRX file and comes in a zipped file. Here ".crx" file is the format for Mock:Intercept and directly return data extension that contains all the data.

Step 2: Extract &Arrange Files

Once the file is downloaded, extract that file into its own folder. Similarly, give that extension files a permanent home. In other words, keep it in a folder that you don't accidentally delete it because these files will be needed to make that extension work.

Step 3: Go to the Chrome Extensions Page

Open Google Chrome and in the address bar, type chrome://extensions; it will open the Google Chrome extensions page. Make sure that "My extensions" is selected in the sidebar.

Step 4: Drag and Drop the Extension

Now, go to the folder where you extracted the Mock:Intercept and directly return data extension and drag &drop the extension file from there anywhere onto the extension page within Google Chrome.

Step 5: Complete the Installation

Once you drag and drop the extension file, follow the steps that Google Chrome takes you through. Similarly, if the extension file is of .crx file format, you will be required to review the permissions and then add the extension.

Now, you can manage that added extension as you would like to with any other Chrome extension that you added through Chrome Webstore. Its icon will also appear in the Google Chrome Menu on the right side of the address bar once you activate it.

Method 2: Download Mock:Intercept and directly return data extension for Chrome and install in Developer Mode

This is another method to install Mock:Intercept and directly return data extension manually, but the twist is that here, you install by enabling the developer mode option provided in Google Chrome. This mode is commonly used for testing extensions or running unpublished tools.

Step 1: Download the Mock:Intercept and directly return data extension file

Select and download the Mock:Intercept and directly return data extension by clicking the 'Download CRX' button on the website.

Step 2: Extract the downloaded contents

Convert the file to a ZIP file if it is in CRX format then extract the Mock:Intercept and directly return data extension zip file or folder that you downloaded. Make sure you extract it using the same folder name and keep it safely in another folder, so you don't delete it by mistake. The extracted folder will be needed to keep your Mock:Intercept and directly return data extension running.

Step 3: Open Chrome Extension Setting Page

In the address bar of Google Chrome, type chrome://extensions and open the Chrome Extension Page.

Step 4: Enable Developer Mode

After opening the Chrome Extension page, look at the top right side, and you will find the toggle option of "Developer mode."Simply enable that developer mode option.

Step 5: Load the Unpacked Extension

Once you enable the developer mode option, you will see the menu of Load Unpacked, Pack Extensions and Update. From that, select the option "Load unpacked."

Step 6: Select the Extension Folder

Once the pop-up opens upon clicking Load unpacked, select the Mock:Intercept and directly return data extension directory and click on the "Select Folder "button.

Step 7: Confirm and Install

After you select an extension folder of a Google Chrome extension you're installing manually, confirm its installation for the final time and let the installation complete.

Conclusion

Here we've made a step-by-step guide on How to manually install Mock:Intercept and directly return data extension in 2 ways. We hope this guide proves helpful.

Similar Extensions

icon

Apifox Browser Extension Extension · Developer Tools 1,000+ 9 ★ 28.39KiB

icon

Mockiato: Mocks on the Fly! Extension · Developer Tools 1,000+ 8 ★ 477KiB

icon

tweak: mock and modify HTTP requests Extension · Developer Tools 1,000+ 190 ★ 3.22MiB

icon

Ajax Interceptor Tools Extension · Developer Tools 1,000+ 12 ★ 2.31MiB

icon

Mock Proxy Extension · Developer Tools 1,000+ 4 ★ 2.03MiB

icon

XSwitch Extension · Developer Tools 1,000+ 18 ★ 1.6MiB

icon

ModResponse - Mock and replay API Extension · Developer Tools 1,000+ 23 ★ 454KiB

icon

YMock: Mock API calls info Extension · Developer Tools 1,000+ 2 ★ 1.68MiB

icon

Ajax Modifier Extension · Developer Tools 1,000+ 48 ★ 2.08MiB

icon

稀土掘金 Extension · Productivity 1,000+ 339 ★ 4.66MiB

icon

MockMan - mock APIs Extension · Productivity 1,000+ 17 ★ 2.3MiB

icon

Requestly - Intercept, Modify & Mock HTTP Requests Extension · Developer Tools 1,000+ 1227 ★ 876KiB

icon

Mokku Extension · Developer Tools 1,000+ 76 ★ 3.28MiB

icon

Ajax Proxy Extension · Developer Tools 1,000+ 8 ★ 835KiB

icon

Console Importer Extension · Developer Tools 1,000+ 20 ★ 9.55KiB

icon

FeHelper(前端助手) Extension · Developer Tools 1,000+ 321 ★ 2.72MiB

icon

Octotree - GitHub code tree Extension · Developer Tools 1,000+ 1139 ★ 3.54MiB

icon

Parrot API mocking Extension · Developer Tools 1,000+ 5 ★ 3.6MiB

icon

PostWoman Http Test Extension · Developer Tools 1,000+ 46 ★ 834KiB

icon

JSON-handle Extension · Developer Tools 1,000+ 450 ★ 193KiB

icon

Oh-my-Mock Extension · Developer Tools 1,000+ 8 ★ 7.07MiB

icon

草料二维码-快速生码和解码工具 Extension · Accessibility 1,000+ 73 ★ 289KiB

icon

Vue.js devtools Extension · Developer Tools 1,000+ 43 ★ 2.08MiB

icon

二维码(QR码)生成器(QR Code Generator) Extension · Productivity 1,000+ 124 ★ 94.16KiB

User reviews

icon

Мадам Брошкина (ID: 000000a4244a600f) Voted 5 ★ - Updated 08/28/2024 Великолепно, отлично подменяет Response Body. Если будите развивать расширение, можно было бы сделать включение/выключение всей группы сразу. И думаю, у вас отлично получились бы и другие виды управления запросами. Удачи! PS немного разочаровалась. Удаляет пробелы