ReferenceError - olark is undefined

Created on 22 December 2017, about 7 years ago
Updated 12 December 2023, about 1 year ago

Thanks for your help with this library!

Certain users' browsers block the Olark javascript snippet, possibly via adblockers or privacy settings. It results in this error:

ReferenceError: olark is not defined

I'm not sure what the best convention for javascript is, but one option would be to set a default for olark at the bottom of the javascript file, i.e.,

}(Drupal, window.olark || null, navigator)); // You would then need to check olark===null rather than olark===undefined above.

Another option could be to pass window to the function and check for window.olark rather than assuming olark exists already.

πŸ› Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024