Skip to main content
Closed for Voting

Widget errors with Content Security Policy

Related products:Freshdesk
  • June 23, 2020
  • 0 replies
  • 45 views

I've added the widget in webpage. When I open Chrome - Inspect - Console, I see the following error:

Refused to load the script 'https://widget.freshworks.com/widgets/xxxxxxxxxxx.js' because it violates the following Content Security Policy directive: "default-src 'self' 'unsafe-inline' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'default-src' is used as a fallback.

(I changed our number to xxxxxxxxxxx)

 

This is the content of a testpage:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">

</head>

<body>

TEST<BR>

<script>

 window.fwSettings={

 'widget_id':xxxxxxxxxxx

 };

 !function(){if("function"!=typeof window.FreshworksWidget){var n=function(){n.q.push(arguments)};n.q=[],window.FreshworksWidget=n}}() 

</script>

<script type='text/javascript' src='https://widget.freshworks.com/widgets/xxxxxxxxxxx.js' async defer></script>

</body>

</html>

 

 

I tried adding:  

<meta http-equiv="Content-Security-Policy" content="default-src 'self' widget.freshworks.com">

 

I only get more errors.  

Could someone help me out? I'm not a webdeveloper (clearly), but I assume this widget needs a (almost) standard set of the Content Security Policy (CSP)?