preface

Most of the front ends run into this problem: you’re trying to verify a simple thing, but the preconditions are too difficult to do, and you’re in pain. What is too difficult to accomplish here might be:

  • The business process is too long (not familiar with the process or lazy to go through it again)

  • Can not change the database anytime and anywhere (there is no condition to change, I can not change or do not want to bother the backend students to change)

  • It’s a test environment that needs to be verified, not hard-coded on the front end

  • Don’t want to use agent software (unnecessary, unused, cumbersome to install, configure, etc.)

This is not a recent work often encountered this kind of problem, I found several similar plug-ins feel not very good, so I took time to implement one.

demo

The Easy Interceptor is an Easy Interceptor, but it’s also an Easy Interceptor

The principle of

Proxy XMLHttpRequest methods, properties, overrides XMLHttpRequest

The characteristics of

  • Import and export, project serialization
  • Listen for the current request and omit the hassle of filling it out
  • Json Editor is integrated to make editing Json easier
  • Use specific functions to streamline data to avoid page stalling caused by large JSON

The shorten function only handles long arrays and strings, not deep data

Function shorten(data, config = {stringLength: 200, arrayLength: 10}) {if (! data) return data if (Array.isArray(data)) { return data.slice(0, config.arrayLength).reduce((acc, item) => (acc.push(shorten(item, config)), acc), []) } if (typeof data === 'object') { return Object.keys(data).reduce((acc, key) => (acc[key] = shorten(data[key], config), acc), {}) } if (typeof data === 'string') { return data.slice(0, config.stringLength) } return data }Copy the code

To be perfect

  • There is currently no support for multiple languages
  • The dark mode is not well supported, now the dark mode is completed by USING CSS Filter temporarily (at the same time, antD dark theme file will be introduced, and vite will introduce this as required. It is not clear how to configure this)
  • Depending on the situation, you can iterate on other features as well

Download address

Please go to github release page to download it, the plugin market is not released ($5 to be a Google developer, don’t want to spend it)

reference

  • Github.com/sxei/chrome…

  • Github.com/YGYOOO/ajax…

  • Github.com/sinonjs/nis…

  • Github.com/code-mancer…