Mocks api responses for AJAX (XHR) requests. (Postman for Frontend)
MockMan - mock APIs Extension
This is essentially built to increase productivity in frontend development. Made for developers, it lets users to define rules (url, method and mock response) to respond to AJAX calls.
Supports all common libraries like axios, superagent, XMLHttp, fetch etc.
Response can be a JSON object or an error.
It includes a JSON formatter to automatically convert your response in proper json format.
Each rule can be individually turned on/off to apply mocking.
There's a global power switch to turn off mocking all the rules at once.
The JSON object maker lets users to make the object in JS syntax and the formatter will convert it into valid JSON object with inverted commas and no trailing commas etc.
Features:
1. Urls can be absolute complete paths or regex enabled.
2. Labels for rules, so user can add different versions of same api
3. Delay in response
4. Test your app with success and error responses.
5. Add response headers along with mock response in the rule.
Steps for Users -
1. Define the api url, method, response JSON or error msg to be mocked.
2. Refresh the project and the ajax / fetch request will be mocked. Mocked url will disappear from network tab and appear in console if rule matches.
For any query or bug report or feature request - reach out to [email protected].
This extension is made with love for fellow developers. If this helps you, support us with good reviews :))
Let's build stuff.
Read more
Supports all common libraries like axios, superagent, XMLHttp, fetch etc.
Response can be a JSON object or an error.
It includes a JSON formatter to automatically convert your response in proper json format.
Each rule can be individually turned on/off to apply mocking.
There's a global power switch to turn off mocking all the rules at once.
The JSON object maker lets users to make the object in JS syntax and the formatter will convert it into valid JSON object with inverted commas and no trailing commas etc.
Features:
1. Urls can be absolute complete paths or regex enabled.
2. Labels for rules, so user can add different versions of same api
3. Delay in response
4. Test your app with success and error responses.
5. Add response headers along with mock response in the rule.
Steps for Users -
1. Define the api url, method, response JSON or error msg to be mocked.
2. Refresh the project and the ajax / fetch request will be mocked. Mocked url will disappear from network tab and appear in console if rule matches.
For any query or bug report or feature request - reach out to [email protected].
This extension is made with love for fellow developers. If this helps you, support us with good reviews :))
Let's build stuff.
Source Manifest.json
{"update_url": "https://clients2.google.com/service/update2/crx", "manifest_version": 3, "name": "MockMan - mock APIs", "description": "Mocks api responses for AJAX (XHR) requests. (Postman for Frontend)", "version": "4.3.2", "action": { "default_icon": "assets/icon-dark.png" }, "devtools_page": "devtools.html", "background": { "service_worker": "background.js" }, "content_scripts": [ { "matches": [""], "run_at": "document_start", "all_frames": true, "js": ["globals.js", "content-script.js"] } ], "sandbox": { "pages": ["sandbox.html"] }, "permissions": [ "storage", "unlimitedStorage" ], "web_accessible_resources": [ { "resources": ["app/*", "mocky.prod.js"], "matches": ["*://*/*"] }, { "resources": ["app/*", "mocky.prod.js"], "matches": ["file:///*"] } ]}
Read more