Mock API in a Chrome extension

1 · Jennie · May 1, 2021, 4:30 a.m.
Mock is critical in the development nowadays. Web developer like us often use tools like Mockon, Node server, API platform, Service Worker(such as msw), etc. In fact, there is another way maybe more productive for a web developer - browser extension, as we can avoid switching between editor and browser frequently. And the basic idea could be concluded in single sentence: hijacking the API requests from the page, and if the request matches our requirement (e.g. URL exact match), response with m...