-
-
Notifications
You must be signed in to change notification settings - Fork 140
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: prevent misuse of transformOptions #389
Conversation
@@ -337,7 +337,6 @@ func (p *pageImpl) Screenshot(options ...PageScreenshotOptions) ([]byte, error) | |||
} | |||
} | |||
overrides["mask"] = masks | |||
options[0].Mask = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be overridden without assigning nil
Hi, I have a little question about how to fix this issue. I understand the playwright is based on the So I think the But the screenshot properties of playwright-go provides is a bit different from As mentioned above, I think the I would like to learn the |
playwright-go communicates with playwright server cli via stdin/out, see Line 208 in ddc7abd
|
Playwright for Go (client) -> Playwright driver (server) -> CDP |
Hi all, Thank you for protocol reference link and data flow describe, which helped me understood how the playwright-go to call the CDP throught playwright driver. In playwright-go, write the message via stdin/out as @canstand said. Lines 75 to 80 in ddc7abd
The message is formattd as JSON, like as below: {
"guid": "page@062788f754dd92af98243a1c957eb01a",
"id": 22,
"metadata":
{
"apiName": "SerializeCallStack",
"isInternal": false,
"location":
{
"file": "connection.go",
"line": 152
},
"wallTime": 191577195
},
"method": "screenshot",
"params":
{
"mask":
[
{
"frame":
{
"guid": "frame@c1bdcb321ef5827508f483b621232c6e"
},
"selector": "//*[@id=\"btnLogin\"]"
}
],
"maskColor": "rgba(255,0,255,0.5)"
}
} And the code of the playwright driver to receive the message as below: The stdin/out protocol must reference cli protocol. Thanks again. |
transformOptions
was previously restricted and does not report misuse.Now no longer restricted, and it is more intuitive to take
overrides
as the second argument when calling it.