Giter VIP home page Giter VIP logo

Comments (8)

james-tindal avatar james-tindal commented on May 18, 2024

Also, while the class constructors have keys, they are all undefined

from playwright.

mxschmitt avatar mxschmitt commented on May 18, 2024

This sounds expected, you can access ipcRenderer in the renderer process (BrowserWindow's) of your Electron application. Usually you are using sandboxing, so its only available inside the preload.

from playwright.

james-tindal avatar james-tindal commented on May 18, 2024

The type is intended to not match runtime behaviour?

from playwright.

mxschmitt avatar mxschmitt commented on May 18, 2024

electronApp.evaluate will run in the Electron main process which is different to the render process. So from my side this seems all working as intended and the type is matching. Could you elaborate more on that?

from playwright.

james-tindal avatar james-tindal commented on May 18, 2024

The issue is not that ipcRenderer is not available. The issue is that the type does not reflect the structure of the value at runtime. As illustrated in the image in the original post. It's a diff of the keys specified by the type and the actual keys in the object. Plus the value for all of the PascalCase keys is undefined, also contradicting the type.

The issue is not that ipcRenderer is not on the object. The issue is that the type says it is.

from playwright.

mxschmitt avatar mxschmitt commented on May 18, 2024

contextBridge, ipcRenderer, webFrame, webUtils sounds expected to me that they are missing, according to the Electron docs these properties are only available in the Electron renderer process: https://www.electronjs.org/docs/latest/api/ipc-renderer.

For the PascalCase style attributes, this looks wrong to me, since even their official don't work with the latest Electron:

// @ts-check
// As per https://github.com/electron/electron/blob/main/docs/api/web-contents-view.md#webcontentsview
const { BaseWindow, WebContentsView } = require('electron')
// As per https://github.com/electron/electron/blob/main/docs/api/view.md
const { BaseWindow, View } = require('electron')
const win = new BaseWindow()
const view = new View()

from playwright.

mxschmitt avatar mxschmitt commented on May 18, 2024

As by talking to folks on Electron side (thanks @codebytere), BaseWindow and WebContentsView are classes which were already exposed in Electron v29 but were not officially released yet. As part of Electron v30, they are in their public API -> types and by that exposed.

Closing by that since there is no action item on our side.

from playwright.

james-tindal avatar james-tindal commented on May 18, 2024

I don't understand how any of this justifies the fact the types do not reflect runtime values.

If ipcRenderer is never attached to this object, why does the type say it always is?
Why are there 9 keys that the type says are class constructors but in reality are nothing?

Also, I need the Menu constructor so I can test my app. Is there any way of getting it?

from playwright.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.