Abstract

An integrated simulation and interception request and has a certain programming ability of Google browser plug-in, which storage capacity, size with color do indicate, simple interface, friendly interaction. This applies to development, test, and production environments because it is not dependent on or intrusive to the project.

Usage scenarios

Imagine trying to verify a simple thing, but the preconditions for repeating the problem are too difficult to complete, causing you pain. What is too difficult to accomplish here might be:

  • The business process is too long (not familiar with the process or don’t want to go through it again)
  • It’s a test environment that needs to be verified, not hard-coded on the front end
  • Difficult to modify database (no conditional changes, no changes, or don’t want to bother with back-end changes)
  • Don’t want to use agent software (unnecessary, unused, cumbersome to install, configure, etc.)

How to solve these problems? This can be done if the data can be intercepted, modified and returned before the client receives it. Easy Interceptor takes advantage of the above ideas. It can intercept HTTP requests in the form of XMLHttpRequest and fetch data requests, and modify the data by overwriting the response and responseText fields. As a Chrome plugin, it is naturally integrated in the user test environment, so it is of minimal mental burden to the user.

  • XHR: A fake XMLHttpRequest is implemented internally, so xHR-type requests do not make requests to the back end and do not require back-end service support (the XHR type relies on Ajax-fake)
  • Fetch: the method and attribute on the Proxy overwrites specific fields, so delay and status fields cannot be configured, and requests will still be sent, which can only take effect if the interface is normal, and the devtool-network information will not be changed (fetch type uses Proxy).

Note:

The plug-in is only valid for content-Type: JSON

If you are a skilled pull full, have a perfect proxy environment do not need to use, only as a supplement for specific occasions

The characteristics of

  • Free, no advertising promotion, better user experience
  • Provides to listen for the current request (omitting the hassle of filling it out manually)
  • Integrate Monaco-Editor for easier editing and processing of text (10W lines of data will not get stuck)
  • Import and export, project serialization
  • More friendly interaction, using color to highlight the current state
  • Have certain JS programming ability, can process data dynamically, can print output information

Directions for use

Dynamic graph demonstration

See the older version below for details

Q&A

Why is the plug-in window only 800×600

This is browser-limited, the popup format supports up to 800×600. The advantage of this format is that it does not affect the project as much as possible (the disadvantage is that the page is reloaded every time, so the plug-in does a lot of serialization to ensure a good user experience).

Storage is only 5M. How to break the limit

The response panel can be set to NULL, and the code panel can modify the data through JS (note: real requests will be sent at this time, depending on the back-end service).

Why 262KB

So just to make it easier to write a program, y = f(x) = log2(x), and I take an arithmetic sequence with a tolerance of 2:18, 20, 22; So 2 to the 18th is 262,144, and these values are just right.

Why does FETCH not support mock requests

Mainly due to not finding the right library, the XHR type is a modified Ajax-fake; And most of the current applications are xHR-based, so only the FETCH is brokered to intercept requests, with slightly less functionality.

Why only JSON requests are supported

At first in order to solve the problem of self-test phase where part of repetition (before and after the end of the application of interactive basic it is now a json type), was used during several similar plugins found the user experience is not very good, some agent software function is very strong, but the individual also don’t like too heavy configuration, use the environment as a single.

Download resources

As it costs $5 to become a Google developer, this app is not available on the Google Marketplace, please go to github release page to download it.

Instructions for older versions (before V1.4)

Juejin. Cn/post / 701465…