# Any approved method for adding Javascript before body close?

**URL:** https://meta.discourse.org/t/any-approved-method-for-adding-javascript-before-body-close/169126
**Category:** Support
**Created:** [November 3, 2020, 3:22pm UTC](https://meta.discourse.org/t/any-approved-method-for-adding-javascript-before-body-close/169126 "2020-11-03T15:22:32Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [November 5, 2020, 2:25am UTC](https://meta.discourse.org/t/any-approved-method-for-adding-javascript-before-body-close/169126/6 "2020-11-05T02:25:28Z")

</div>

> [@Jim\_Starkweather](#):
>
> Uncaught EvalError: Refused to evaluate a string as JavaScript because ‘unsafe-eval’ is not an allowed source of script in the following Content Security Policy directive: "script-src…

You can whitelist evals in the content security policy site setting, see [Mitigate XSS Attacks with Content Security Policy](https://meta.discourse.org/t/mitigate-xss-attacks-with-content-security-policy/104243).

We do not recommend this though, it opens your site to security exploits.

---

_[View the full topic](https://meta.discourse.org/t/any-approved-method-for-adding-javascript-before-body-close/169126)._
