fix: NativeImage serialization of <webview>.capturePage() result (#20825)

This commit is contained in:
Milan Burda 2019-11-12 21:56:17 +01:00 committed by Alexey Kuzmin
parent c0657a4ca7
commit 1d596f616d
12 changed files with 67 additions and 44 deletions

View file

@ -4,13 +4,13 @@ const clipboard = process.electronBinding('clipboard')
if (process.type === 'renderer') {
const ipcRendererUtils = require('@electron/internal/renderer/ipc-renderer-internal-utils')
const clipboardUtils = require('@electron/internal/common/clipboard-utils')
const typeUtils = require('@electron/internal/common/type-utils')
const makeRemoteMethod = function (method) {
return (...args) => {
args = clipboardUtils.serialize(args)
args = typeUtils.serialize(args)
const result = ipcRendererUtils.invokeSync('ELECTRON_BROWSER_CLIPBOARD', method, ...args)
return clipboardUtils.deserialize(result)
return typeUtils.deserialize(result)
}
}