← Back to DOM domain

DOM.forceShowPopover

When enabling, this API force-opens the popover identified by nodeId and keeps it open until disabled.

Domain: DOM experimental

Parameters

NameTypeDescription
nodeIdNodeIdId of the popover HTMLElement
enablebooleanIf true, opens the popover and keeps it open. If false, closes the popover if it was previously force-opened.
invokerNodeId (optional)BackendNodeIdOptional ID of the element invoking this popover, used to establish the implicit anchor. If not provided, it will fall back to the first invoker in the document, preferring elements with a popovertarget attribute over those with a commandfor attribute. Note that if there are multiple invokers, this is just an estimate.

Returns

NameTypeDescription
nodeIdsarrayList of popovers that were closed in order to respect popover stacking order.

Example Request

{
  "id": 1,
  "method": "DOM.forceShowPopover",
  "params": {
    "nodeId": 1,
    "enable": true
  }
}

Example Response

{
  "id": 1,
  "result": {
    "nodeIds": [
      3,
      4,
      5
    ]
  }
}

Usage in Node.js

const result = await send('DOM.forceShowPopover', {"nodeId": 1, "enable": true});
console.log(result);
// {"nodeIds": [3, 4, 5]}