Skip to content

Conversation

khoan
Copy link

@khoan khoan commented Aug 3, 2023

Why?

We have lots of javascript code that blindly invokes window.Intercom(...) expecting that it's a function. The assumption that window.Intercom is always a function breaks down, when IntercomRails::AutoInclude::Filter is evaluated to exclude javascript, which results in JS runtime error.

How?

This PR adds a configurable callback method on a controller for case when IntercomRails::AutoInclude::Filter excludes javascript. Within the controller callback, a shim can be added to ensure that window.Intercom is indeed a function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant