learn-co-curriculum / fewpjs-use-fetch

Other
0 stars 83 forks source link

example fetch to astros.json no longer works #3

Closed geluso closed 5 years ago

geluso commented 5 years ago

Problem Description

Instructions are incorrect for sample code trying out fetch.

"Let's perform a trivial demonstration. Open up a new incognito tab in Chrome. Open up DevTools and paste the following:"

Executing the sample code in an incognito tab crashes my chrome console. It can't run on GitHub or a new tab page either. It only runs when executing in a tab for http://open-notify.org/ itself.

Running in incognito ends with "DevTools was disconnected" error.

Screen Shot 2019-03-11 at 3 20 26 PM

Various Failure Descriptions

Can't run fetch in Chrome Dev Tools on GitHub. Can't run

VM53:1 Refused to connect to 'http://api.open-notify.org/astros.json' because it violates the following Content Security Policy directive: "connect-src 'self' uploads.github.com www.githubstatus.com collector.githubapp.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com wss://live.github.com".

Can't fun fetch in Chrome Dev Tools in new tab page.

VM50:1 Mixed Content: The page at 'https://www.google.com/_/chrome/newtab?ie=UTF-8' was loaded over HTTPS, but requested an insecure resource 'http://api.open-notify.org/astros.json'. This request has been blocked; the content must be served over HTTPS.

It DOES work if you open the Chrome Inspector at their page http://open-notify.org/.

Resolution

Update instructions to tell people to navigate to http://open-notify.org/ and open their Chrome Dev tools from there.

sgharms commented 5 years ago

Merged the PR. FWIW, if you know the fix, you can open PRs w/o an issue.