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

πŸ› Widget Embed Browser Compatibility

Open creativeindustriesgroup opened this issue 6 months ago β€’ 2 comments

Describe the bug Widget embed seems to only intermittently work. The issue seems to fire less frequently in Safari, but seems to be consistent with Chrome and Firefox - possibly a race condition.

An error is presented in the console: hook.js:608 HiEvent widget error: Invalid script URL

To Reproduce Steps to reproduce the behavior:

  1. embed the script in the
  2. tags: (note that the hi.events domain is different to the domain where the widget is embedded)
  3. Embed a widget into the page
  4. Loading the page intermittently throws the error. I had some luck re-producing more often the embed website being in http://.

Additional context widget.js uses document.currentScript in order to retrieve the current hostname. I believe this is not always reliable in every browser or scenario. PR incoming.

creativeindustriesgroup avatar Jul 21 '25 21:07 creativeindustriesgroup

Thanks for the report, @creativeindustriesgroup! I haven't been able to recreate this, but after read some more about document.currentScript, I can see it could be a problem.

daveearley avatar Jul 23 '25 04:07 daveearley

Hey Dave,

The widget is being used in a ~10 year old Wordpress website, so it is probably something to do with that.

The above PR does resolve the issue but I realise that it is not backwards compatible. I can revisit if necessary.

That said, I’m developing a new website with Hi.Events API integrations so once that’s done we will no longer be using the widget/have the problem.

creativeindustriesgroup avatar Jul 23 '25 10:07 creativeindustriesgroup