agentops icon indicating copy to clipboard operation
agentops copied to clipboard

Add Entelligence Script back again

Open fernando-plank opened this issue 9 months ago • 0 comments

📥 Pull Request

📘 Description

Entelligence Chat Widget Initialization Improvements

Changes

  • Moved script loading to document head instead of body for better performance
  • Added defer attribute to main script to ensure proper loading order
  • Implemented shadow DOM styles injection with fallback to document head
  • Added interval-based retry mechanism for shadow DOM initialization
  • Improved script loading sequence with proper event handling

Technical Details

  • The widget now loads its styles both in shadow DOM and as fallback in document head
  • CSS is fetched from S3 and injected dynamically
  • Widget initialization waits for DOM content to be loaded
  • Prevents duplicate script injection by checking for existing script tag

🧪 Testing

Please verify:

  • Widget loads correctly on page load
  • Styles are properly applied in both shadow DOM and fallback scenarios
  • The style is breaking the page

fernando-plank avatar Mar 10 '25 19:03 fernando-plank