by fortunateregard · 3y ago · 0 comments
To illustrate, assume I frequently browse a blog and want to trick my browser into thinking that I have "favorited" every post. It's trivial to write a for loop that iterates over response.json and sets `is_favorite = true`. But it's not as clear to me where this script should ideally live in order to have the logic always executed before the response is made available to the site.
Your comment made me think about whether I can replace my overkill solution (https://requestly.io/) with something lightweight.
Yes but in this case you would need to setup a reverse proxy so your service worker and the intercepted page runs in the same domain. You could use cors-anywhere[1] for that.
Your bet is to use a browser extension to override the response of that specific API and sort of change the response.
PS - Why do you think this is an overkill solution?
Only because my use case is very trivial and does not require most of the features. On the other hand, it did get the job done on the first try so I can't really complain.