# Adding JavaScript to a theme in /head not working (UserWay)

**URL:** https://meta.discourse.org/t/adding-javascript-to-a-theme-in-head-not-working-userway/148799
**Category:** Support
**Created:** [April 22, 2020, 2:32am UTC](https://meta.discourse.org/t/adding-javascript-to-a-theme-in-head-not-working-userway/148799 "2020-04-22T02:32:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![fatbesties](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fatbesties/32/166213_2.png) [@fatbesties](https://meta.discourse.org/u/fatbesties)
#### Post date: [April 22, 2020, 2:32am UTC](https://meta.discourse.org/t/adding-javascript-to-a-theme-in-head-not-working-userway/148799/1 "2020-04-22T02:32:44Z")

</div>

Hi everyone,

I’m trying to customize a theme to add the [UserWay Accessibility](http://userway.org) widget. I’ve copied and pasted exactly what was provided by UserWay in /head, which is where I’ve actually seen it used on another Discourse account ([this one](https://community.povnet.org/login)).

Here is the code:

```
<!-- UserWay accesibility widget -->
<script type="text/javascript">
var _userway_config = {
/* uncomment the following line to override default position*/
/* position: '1', */
/* uncomment the following line to override default size (values: small, large)*/
/* size: 'large', */
/* uncomment the following line to override default language (e.g., fr, de, es, he, nl, etc.)*/
/* language: 'null', */
/* uncomment the following line to override color set via widget (e.g., #053f67)*/
/* color: '#5BC0BE', */
/* uncomment the following line to override type set via widget (1=person, 2=chair, 3=eye, 4=text)*/
/* type: '1', */
/* uncomment the following lines to override the accessibility statement*/
/* statement_text: "Our Accessibility Statement", */
/* statement_url: "community.fatbesties.ca/accessibility-statement", */
/* uncomment the following line to override support on mobile devices*/
/* mobile: true, */
account: 'ACCOUNT_INFORMATION'
};
</script>
<script type="text/javascript" src="https://cdn.userway.org/widget.js"></script>

```

And a screenshot

Any suggestions?

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [April 22, 2020, 3:45am UTC](https://meta.discourse.org/t/adding-javascript-to-a-theme-in-head-not-working-userway/148799/3 "2020-04-22T03:45:52Z")

</div>

Try adding `https://cdn.userway.org` to the

`content_security_policy_script_src`

site setting and see if that resolves your issue.

Like so

 ![CSP whitelist setting](https://global.discourse-cdn.com/meta/original/3X/6/a/6af0a9f3456ae93f3dcab7c7daf98179fc267489.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 23, 2020, 5:09pm UTC](https://meta.discourse.org/t/adding-javascript-to-a-theme-in-head-not-working-userway/148799/8 "2020-04-23T17:09:48Z")

</div>

A post was split to a new topic: [Automatically adding theme scripts to CSP](https://meta.discourse.org/t/automatically-adding-theme-scripts-to-csp/149028)

---

<div class="post-metadata">

### Author: ![fatbesties](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fatbesties/32/166213_2.png) [@fatbesties](https://meta.discourse.org/u/fatbesties)
#### Post date: [April 29, 2020, 11:13pm UTC](https://meta.discourse.org/t/adding-javascript-to-a-theme-in-head-not-working-userway/148799/10 "2020-04-29T23:13:19Z")

</div>

Thanks, @Johani, that worked! 👏 👏 👏 👏

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 29, 2020, 11:13pm UTC](https://meta.discourse.org/t/adding-javascript-to-a-theme-in-head-not-working-userway/148799/11 "2020-05-29T23:13:24Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
