Skip to content

matas-sh/mocky

Repository files navigation

Mocky

Mocky is a browser extension that resolves outgoing client-initiated network requests with pre-determined responses recorded in .har file. Below is a quick demo:

How are the requests resolved?

Primer: A HAR file contains a record of all data exchanged between client and server. The data is recorded in <request, response> pairs and segmented by pages

An intiated request is matched to request present in the .har file based on following values:

  • Request URL
  • Request method (GET/POST/...)
  • Request Post data (if present)
  • Resource type of the response data (XHR/Fetch/Document)

Once a matching request is found in the provided file, the network request is resolved with response which is part of the same <request, response> pair as the request

Current features

  • Select the resource types to base request matching on
  • Ignore hostname of the request (only match request on the path which proceeds the hostname)

Extension currently published:

  • Chrome
  • Firefox
  • Opera (Chrome Build)
  • Edge (Chrome Build)
  • Brave
  • Safari

Credit to Debdut Karmakar for extension template

About

Substitute browser made requests with a HAR file

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published