mdn / content

The content behind MDN Web Docs
https://developer.mozilla.org
Other
9.18k stars 22.47k forks source link

Problem with completing Task 3 #36522

Open nardebili opened 4 hours ago

nardebili commented 4 hours ago

MDN URL

https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Video_and_audio_content/Test_your_skills:_Multimedia_and_embedding

What specific section or headline is this issue about?

Task 3

What information was incorrect, unhelpful, or incomplete?

Could not get the embedding to work - caused a number of CSP related errors in the developer console: valError: call to eval() blocked by CSP Content-Security-Policy: The page’s settings blocked a JavaScript eval (script-src) from being executed because it violates the following directive: “script-src 'report-sample' 'self' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js https://assets.codepen.io https://production-assets.codepen.io https://js.stripe.com 'sha256-EehWlTYp7Bqy57gDeQttaWKp0ukTTEUKGP44h8GVeik=' 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M='” (Missing 'unsafe-eval') Source: ;(function n(e){let t=1e3,n=10;function …

Nor did the link to the media/my-pdf.pdf file would work - 404 error

What did you expect to see?

I expected to see the pdf file to load into the page as an embedded object.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details * Folder: `en-us/learn/html/multimedia_and_embedding/video_and_audio_content/test_your_skills_colon__multimedia_and_embedding` * MDN URL: https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Video_and_audio_content/Test_your_skills:_Multimedia_and_embedding * GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/learn/html/multimedia_and_embedding/video_and_audio_content/test_your_skills_colon__multimedia_and_embedding/index.md * Last commit: https://github.com/mdn/content/commit/baac7f2a43813a7930ff97b11d9c38b413f97c78 * Document last modified: 2024-10-25T00:08:46.000Z
hamishwillee commented 2 hours ago

The 404 error means that the file you are trying to load (media/my-pdf.pdf) is not in the location that the page expects it. In your code you're going to need to point to the file, which can be found here: https://github.com/mdn/learning-area/blob/main/html/multimedia-and-embedding/tasks/media-embed/media/mypdf.pdf

It may be that you are pointing to that file, but it is being blocked by CSP, but I don't think so. The other CSP issues look spurious (not related to this case).

I suggest you try this locally.

If you want more help debugging please explain how you are testing this - locally, in the windows above, and exactly what code you are using. Also what browser.