Skip to content

🐛 Widget Embed Browser Compatibility #676

@creativeindustriesgroup

Description

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 tags: <script async src="https://someexternaldomain.com/widget.js"></script> (note that the hi.events domain is different to the domain where the widget is embedded)
  2. Embed a widget into the page
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions