Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(playground): avoid stringifying invalid console messages #11150

Merged
merged 1 commit into from
May 21, 2024

Conversation

caugner
Copy link
Contributor

@caugner caugner commented May 17, 2024

Summary

(MP-1063)

Follow-up to #10962.

Problem

Invalid console messages can crash the Playground.

Solution

Avoid stringifying invalid console messages.


How did you test this change?

  1. Ran yarn && yarn dev and opened http://localhost:3000/en-US/play
  2. Pasted in the following JavaScript:
    var o = {};
    o.x = o;
    parent.postMessage({typ:'console',prop:'log',message:o}, '*');
  3. Verified that the Playground doesn't crash and the Playground console shows:

    [Playground] Unsupported console message (see browser console)

@caugner caugner requested a review from a team as a code owner May 17, 2024 22:06
@caugner caugner merged commit 90072c8 into main May 21, 2024
14 checks passed
@caugner caugner deleted the MP-1063-avoid-stringify-playground-user-input branch May 21, 2024 17:23
pepelsbey pushed a commit to pepelsbey/mdn-yari that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants