<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hidden Chat Widget suddenly appears in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Hidden-Chat-Widget-suddenly-appears/m-p/966082#M73086</link>
    <description>&lt;P&gt;So before actually discovering that there's a built-in function to &lt;A href="https://legacydocs.hubspot.com/docs/methods/conversations_api/widget_remove" target="_blank" rel="noopener"&gt;remove&lt;/A&gt;/&lt;A href="https://legacydocs.hubspot.com/docs/methods/conversations_api/widget_load" target="_blank" rel="noopener"&gt;load&lt;/A&gt; a widget, we are doing it using a CSS class:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const hubspot = document.getElementById('hubspot-messages-iframe-container');
if (hubspot &amp;amp;&amp;amp; role === 'admin') {
    hubspot.classList.add('hide-hubspot');
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;.hide-hubspot {
  visibility: hidden;
  height: 0 !important;
  width: 0 !important;
  display: none !important;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We only do this if the authenticated user on our site is an admin. If not or unauthenticated, we remove that class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For some reason, the widget came back and we're not able to reproduce how it happened. I'm thinking it's because there's some code in the hubspot embed script that reloads the widget but not sure when/where does it happen?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am about to open a pull request that replaces our own hide/show class to using the built-in APIs but I'd be happy to know what's the possible cause that let the widget be visible again. Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2024 17:23:17 GMT</pubDate>
    <dc:creator>rasoriano</dc:creator>
    <dc:date>2024-04-24T17:23:17Z</dc:date>
    <item>
      <title>Hidden Chat Widget suddenly appears</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Hidden-Chat-Widget-suddenly-appears/m-p/966082#M73086</link>
      <description>&lt;P&gt;So before actually discovering that there's a built-in function to &lt;A href="https://legacydocs.hubspot.com/docs/methods/conversations_api/widget_remove" target="_blank" rel="noopener"&gt;remove&lt;/A&gt;/&lt;A href="https://legacydocs.hubspot.com/docs/methods/conversations_api/widget_load" target="_blank" rel="noopener"&gt;load&lt;/A&gt; a widget, we are doing it using a CSS class:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const hubspot = document.getElementById('hubspot-messages-iframe-container');
if (hubspot &amp;amp;&amp;amp; role === 'admin') {
    hubspot.classList.add('hide-hubspot');
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;.hide-hubspot {
  visibility: hidden;
  height: 0 !important;
  width: 0 !important;
  display: none !important;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We only do this if the authenticated user on our site is an admin. If not or unauthenticated, we remove that class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For some reason, the widget came back and we're not able to reproduce how it happened. I'm thinking it's because there's some code in the hubspot embed script that reloads the widget but not sure when/where does it happen?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am about to open a pull request that replaces our own hide/show class to using the built-in APIs but I'd be happy to know what's the possible cause that let the widget be visible again. Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 17:23:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Hidden-Chat-Widget-suddenly-appears/m-p/966082#M73086</guid>
      <dc:creator>rasoriano</dc:creator>
      <dc:date>2024-04-24T17:23:17Z</dc:date>
    </item>
  </channel>
</rss>

