Skip to content

cy.window()

cy.window — Core > Metadata and environment. Cytoscape.js signatures, parameters and return contract.

cy.window — Core › Metadata and environment

Preview · Core › Metadata and environment

Read in the complete API reference · All API members

// The window this instance renders into, or null when there is no DOM (Node)
cy.window(): (Window & typeof globalThis) | null

The window this instance renders into, or null when there is no DOM (Node). Useful for extensions that need the hosting realm.

Returns (Window & typeof globalThis) | null

the global window, or null outside a browser

Example

console.log(cy.window()); // null

Example graph and handle setup