kylepaulsen / ResourceOverride

An extension to help you gain full control of any website by redirecting traffic, replacing, editing, or inserting new content.
MIT License
470 stars 118 forks source link

Responding with JSON #24

Open joshuaManlunas opened 6 years ago

joshuaManlunas commented 6 years ago

Hello Kyle, I hope you would consider adding the feature to respond with JSON so the extension can be used for REST API testing. So when an endpoint is queried we can give the app our own JSON response?

Cheers

kylepaulsen commented 6 years ago

I assume you want to do this with a URL -> File rule. I think this used to work, but maybe not anymore: https://bugs.chromium.org/p/chromium/issues/detail?id=521475#c11 If you want to make fake fetch requests (redirect them to a response you provide), this might only be possible with a URL -> URL rule now... You could always set up a quick server I guess. This is really unfortunate though.

Although wait, old xmlhttprequests seem to work? Not sure why they work but fetch doesnt. Let me know if you figure out anything.