According to this SO post I should be able to run a fetch request from Chrome devtools console. In fact, if I click the button in the post answer, it works.
However, if I try to execute the very same code in the console, it doesn't work.
fetch('https://jsonplaceholder.typicode.com/posts/1')
.then(res => res.json())
.then(console.log)

What's missing?
Don't know why, however it depends on the current domain the browser is:
Home page:

After browsing a page (whatever page):

My guess would be that in the first case there is not an established source domain, but a better error description would help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With