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

[BUG] Firefox: strange undefined toJSON property on JS objects #7015

Closed
creage opened this issue Jun 10, 2021 · 3 comments
Closed

[BUG] Firefox: strange undefined toJSON property on JS objects #7015

creage opened this issue Jun 10, 2021 · 3 comments

Comments

@creage
Copy link

creage commented Jun 10, 2021

Context:

  • Playwright Version: 1.12.1
  • Operating System: Windows
  • Node.js version: 14.6.1
  • Browser: Firefox

Describe the bug
After evaluating some custom code in the context of the page, some of JS objects receive strange toJSON property, which is undefined. Started to happen after upgrade to 1.12. And this happens on Firefox ONLY.

@mxschmitt
Copy link
Member

mxschmitt commented Jun 10, 2021

Caused by #6767

@creage
Copy link
Author

creage commented Jun 10, 2021

Oh gosh, this reminds me old issues you guys might not even heard about 😄

That library taught all of us one thing - you should never modify objects you don't own.

@mxschmitt
Copy link
Member

mxschmitt commented Jun 10, 2021

This was the original reason why we implemented this fix (prototype.js) to bypass a broken Array.prototype.toJSON method. This lead to a broken Array.prototype.toJSON method for all users. Should get fixed soon.

aslushnikov added a commit to aslushnikov/playwright that referenced this issue Jun 10, 2021
The hand-written JSON serializer works in user context and doesn't
invoke `toJSON` methods.

References microsoft#7015
@aslushnikov aslushnikov added this to the v1.12.2 milestone Jun 11, 2021
aslushnikov added a commit to aslushnikov/playwright that referenced this issue Jun 11, 2021
aslushnikov added a commit that referenced this issue Jun 11, 2021
aslushnikov added a commit to aslushnikov/playwright that referenced this issue Jun 11, 2021
Cherry-Pick microsoft#7067 SHA d6831df

NOTE: this cherry-pick updates only firefox-stable build revision
and keeps the firefox-beta as-is since it's been rolled already.
Thus, the new test is explicitly skipped on firefox-beta.

Fixes microsoft#7015
aslushnikov added a commit that referenced this issue Jun 11, 2021
Cherry-Pick #7067 SHA d6831df

NOTE: this cherry-pick updates only firefox-stable build revision
and keeps the firefox-beta as-is since it's been rolled already.
Thus, the new test is explicitly skipped on firefox-beta.

Fixes #7015
aslushnikov added a commit to aslushnikov/playwright that referenced this issue Jun 17, 2021
The hand-written JSON serializer works in user context and doesn't
invoke `toJSON` methods.

References microsoft#7015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants