Gets the data object that was passed to a lightbox.
Retrieves the data object, if any, that was passed when a lightbox
was opened via the openLightbox()
method.
If a lightbox was opened in any other way, getContext()
returns undefined
.
To pass data to a lightbox, it must be opened programmatically using the openLightbox()
method. Lightboxes that are opened automatically on page load, or via a link from a page element don't receive passed data.
function getContext(): object;
import wixWindowFrontend from "wix-window-frontend";
// ...
let receivedData = wixWindowFrontend.lightbox.getContext();
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.