I want this element to programatically display/hid...
# 💡feature-requests
f
I want this element to programatically display/hide my extension. usage:
Copy code
typescript
// Handle action click in content-script (using webext-bridge)

onMessage("showModal", async ({ data }) => {
  // early return
  if (!data.message) return { success: false }

  const plasmoShadowHost = document.getElementById("plasmo-shadow-host")
  if (!plasmoShadowHost) {
    alert(`shadow root not found!`) // NOTE: I'm unable to find this element easily right now.
    return { success:false }
  }
  // toggle visibility of my extension
  plasmoShadowHost.style.display = plasmoShadowHost.style.display === "none" ? "flex" : "none"; // NOTE: Using flex here but can also be whatever, really 
  return { success: true }
})