|
|
|
|
|
by fortunateregard
1026 days ago
|
|
If you want to intercept and modify a incoming json response for some specific url pattern, would a service worker be a good way to do so? 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. |
|