Hi.Events icon indicating copy to clipboard operation
Hi.Events copied to clipboard

fix: get the script by id instead of depending on document.currentScr…

Open creativeindustriesgroup opened this issue 6 months ago • 0 comments

Refactor the current method for getting the current script to make it more reliable. Fixes #676.

Improvements to widget script handling:

  • Updated the widget script identification logic to use document.getElementById('hievent-widget-script') instead of relying on document.currentScript, ensuring the script is explicitly located and validated. This change was applied in both frontend/public/widget.js and frontend/src/embed/widget.js for consistency. [1] [2]
  • Modified the embedScript in the WidgetEditor component to include the id="hievent-widget-script" attribute, aligning it with the updated script identification logic.

(sorry for the import re-organise):

  • imports in frontend/src/components/common/WidgetEditor/index.tsx re-ordered. I opened Hi.Events in the wrong IDE Workspace (sorry!).

creativeindustriesgroup avatar Jul 21 '25 21:07 creativeindustriesgroup