# When install html script facing issue?

**URL:** https://meta.discourse.org/t/when-install-html-script-facing-issue/148507
**Category:** Support
**Created:** [April 19, 2020, 5:45am UTC](https://meta.discourse.org/t/when-install-html-script-facing-issue/148507 "2020-04-19T05:45:35Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [April 20, 2020, 7:06pm UTC](https://meta.discourse.org/t/when-install-html-script-facing-issue/148507/7 "2020-04-20T19:06:24Z")

</div>

Full disclosure - I do not consider myself a CSP guru!

With that said, I _think_ there are scenarios where it would be ideal to whitelist the domain, and other scenarios where it’s better to target the individual scripts. I’m pretty sure it depends on how many scripts you find you need to whitelist, whether you trust the source, etc. I’ll add a note to the guide that mentions that you can use the domain as a cover-all if needed.

The settings in the provided screenshots definitely were a little overkill, but I imagine that was just an attempt to cover **everything** since nothing was working.

I just tried adding Pure Chat to my test site as an experiment. I could get it working on Chrome using a hash, but it wasn’t enough for Safari and Firefox. I ran it by Penar and this does appear to be one of those unfortunate situations that will requrire `'unsafe-inline'` as mentioned in:

> [@Mitigate XSS Attacks with Content Security Policy](https://meta.discourse.org/t/mitigate-xss-attacks-with-content-security-policy/104243/1):
>
> #### 4. Third-Party Script / Service Integration
> 
> Different integrations will have different requirements, but can be addressed similarly.
> 
> You could look up the integration’s recommended CSP whitelist, and extend the default CSP accordingly. I suggest simply [turn on CSP Report Only mode in Discourse](#heading--available-settings), and watch your console to determine which resources you’ll need to whitelist to make your integrations work.
> 
> This is especially important when using third-party script bundlers like Google Tag Manager or Segment, because these bundlers might load many third-party or inline scripts. (You might even end up adding `'unsafe-inline'` when using Segment or GTM, even though this definition should be avoided as much as possible.)

* * *

@BishopV I think your only option if you choose to stay with Pure Chat is to remove all of the entries you have in that setting and add `'unsafe-inline'` at the cost of security.

Have you considered using [Setup HubSpot chat Integration](https://meta.discourse.org/t/hubspot-chat-integration/128777) instead? That appears to play very well with our CSP policy.

---

_[View the full topic](https://meta.discourse.org/t/when-install-html-script-facing-issue/148507)._
