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]: "Failed to serialize arguments" error occurs on right mouse click on "webview" content #31249

Closed
3 tasks done
vladimiry opened this issue Oct 2, 2021 · 3 comments · Fixed by #31259
Closed
3 tasks done

Comments

@vladimiry
Copy link

vladimiry commented Oct 2, 2021

Preflight Checklist

Electron Version

15.1.0 / and all 16.0.0-alpha.x

What operating system are you using?

Other Linux

Operating System Version

kernel 5.14.7-2

What arch are you using?

x64

Last Known Working Electron version

15.0.0

Expected Behavior

No error occurs.

Actual Behavior

The Failed to serialize arguments error occurs on right mouse click on the webview's content.

Testcase Gist URL

No response

Additional Information

Notice there is no error when you do the right mouse click on the browserwindow's content but on webview's.

Notice that adding the "context-menu" handler is not even required.

The "input" controls were added to the snippet just for the convenience of testing. The right mouse click on any area of webview triggers the error.

To reproduce:

const {app, BrowserWindow} = require("electron")

app.whenReady().then(() => {
  //  app.on("web-contents-created", (...[/* event */, webContents]) => {
  //    webContents.on("context-menu", () => {/* NOOP */})
  //  })
  new BrowserWindow({webPreferences: {webviewTag: true}}).loadURL(`data:text/html,
    <html><body>
    <input type='text' value='input'>
    <webview src="data:text/html,<input type='text' value='webview input'>"></webview>
    </body></html>`,
  )
})
@vladimiry vladimiry changed the title [Bug]: "Failed to serialize arguments" error if "context-menu" handler attached to "webContents" of a "webview" [Bug]: "Failed to serialize arguments" error occurs on left mouse click on "webview" content Oct 2, 2021
@vladimiry vladimiry changed the title [Bug]: "Failed to serialize arguments" error occurs on left mouse click on "webview" content [Bug]: "Failed to serialize arguments" error occurs on right mouse click on "webview" content Oct 2, 2021
@vladimiry
Copy link
Author

Might potentially be related to #31057, CC @samuelmaddock.

@VerteDinde
Copy link
Member

@vladimiry The issue closed automatically when I merged the fix PR above, but we're cutting new 15 and 16 releases today - this should be available in 15.1.1 and 16.0.0-beta.5. Thanks again for reporting!

@vladimiry
Copy link
Author

Sounds great. Thanks everyone involved for a quick fix & release.

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

Successfully merging a pull request may close this issue.

4 participants