<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting Refused to load Scripts Error while running custom visual in chrome. in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Getting-Refused-to-load-Scripts-Error-while-running-custom/m-p/3170876#M42056</link>
    <description>&lt;P&gt;I am able to solve this issue by adding&amp;nbsp;&lt;SPAN&gt;privileges setting that allowing access to external resources.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Example :&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;{ &lt;/SPAN&gt;&lt;SPAN class=""&gt;"name"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;"WebAccess"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;"essential"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;"parameters"&lt;/SPAN&gt;&lt;SPAN&gt;: [ &lt;/SPAN&gt;&lt;SPAN class=""&gt;"https://*.microsoft.com"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;A href="http://example.com" target="_blank" rel="noopener"&gt;http://example.com&lt;/A&gt;"&lt;/SPAN&gt;&lt;SPAN&gt; ] }&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Apr 2023 06:15:22 GMT</pubDate>
    <dc:creator>MonikaGole</dc:creator>
    <dc:date>2023-04-04T06:15:22Z</dc:date>
    <item>
      <title>Getting Refused to load Scripts Error while running custom visual in chrome.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Getting-Refused-to-load-Scripts-Error-while-running-custom/m-p/3160752#M41988</link>
      <description>&lt;P&gt;I am loading a external script in power bi custom visual.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;powerbi-visuals-tools version - 4.2.1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Getting following error while running custom visual in developer mode in chrome:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Refused to load the script '&lt;A href="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/viewer3D.js" target="_blank" rel="noopener"&gt;https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/viewer3D.js&lt;/A&gt;' because it violates the following Content Security Policy directive: "default-src &lt;A href="https://app.powerbi.com" target="_blank" rel="noopener"&gt;https://app.powerbi.com&lt;/A&gt; data: blob: 'unsafe-inline' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'default-src' is used as a fallback.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 12:10:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Getting-Refused-to-load-Scripts-Error-while-running-custom/m-p/3160752#M41988</guid>
      <dc:creator>MonikaGole</dc:creator>
      <dc:date>2023-03-29T12:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to load Scripts Error while running custom visual in chrome.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Getting-Refused-to-load-Scripts-Error-while-running-custom/m-p/3163198#M42009</link>
      <description>&lt;P&gt;This error occurs because the script you are trying to load violates the Content Security Policy (CSP) of Power BI, which restricts the types of content that can be loaded into a visual. The CSP directive "default-src &lt;A href="https://app.powerbi.com/" target="_new"&gt;https://app.powerbi.com&lt;/A&gt; data: blob: 'unsafe-inline' 'unsafe-eval'" specifies that only scripts from the Power BI website, data URIs, and inline scripts are allowed. The external script you are trying to load does not meet this criteria.&lt;/P&gt;&lt;P&gt;To resolve this issue, you can modify the CSP directive to allow the external script to be loaded. You can do this by adding the domain of the external script to the "default-src" directive. For example, if the domain of the external script is "example.com", you can modify the directive to "default-src &lt;A href="https://app.powerbi.com/" target="_new"&gt;https://app.powerbi.com&lt;/A&gt; data: blob: 'unsafe-inline' 'unsafe-eval' example.com".&lt;/P&gt;&lt;P&gt;Keep in mind that modifying the CSP directive can pose a security risk, so you should only add domains that you trust.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 11:10:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Getting-Refused-to-load-Scripts-Error-while-running-custom/m-p/3163198#M42009</guid>
      <dc:creator>Adamboer</dc:creator>
      <dc:date>2023-03-30T11:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to load Scripts Error while running custom visual in chrome.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Getting-Refused-to-load-Scripts-Error-while-running-custom/m-p/3164931#M42022</link>
      <description>&lt;P&gt;Thanks for the solution.&lt;/P&gt;&lt;P&gt;I have tried to set the CSP directive in pbiviz.json file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Below is my pbiviz.json file :&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; "visual": {&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "name": "sampleforgeViewervisual",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "displayName": "sample_forgeViewer_visual",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "guid": "sampleforgeViewervisualFE35C237FC27484483545CAFECAFA769",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "visualClassName": "Visual",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "version": "1.0.0",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "description": "",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "supportUrl": "",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "gitHubUrl": "",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "contentSecurityPolicy": "default-src &lt;A href="https://app.powerbi.com" target="_blank"&gt;https://app.powerbi.com&lt;/A&gt; data: blob: 'unsafe-inline' 'unsafe-eval' &lt;A href="https://developer.api.autodesk.com" target="_blank"&gt;https://developer.api.autodesk.com&lt;/A&gt;"&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; },&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; "apiVersion": "5.1.0",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; "author": {&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "name": "",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "email": ""&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; },&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; "assets": {&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "icon": "assets/icon.png"&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; },&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; "externalJS": null,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; "style": "style/visual.less",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; "capabilities": "capabilities.json",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; "dependencies": null,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; "stringResources": []&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;But this is not working.&lt;/P&gt;&lt;P&gt;Could you please tell me where to or how to set CSP directive while creating custom visual?&lt;/P&gt;&lt;P&gt;I am running the visual in developer mode.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 05:48:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Getting-Refused-to-load-Scripts-Error-while-running-custom/m-p/3164931#M42022</guid>
      <dc:creator>MonikaGole</dc:creator>
      <dc:date>2023-03-31T05:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Refused to load Scripts Error while running custom visual in chrome.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Getting-Refused-to-load-Scripts-Error-while-running-custom/m-p/3170876#M42056</link>
      <description>&lt;P&gt;I am able to solve this issue by adding&amp;nbsp;&lt;SPAN&gt;privileges setting that allowing access to external resources.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Example :&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;{ &lt;/SPAN&gt;&lt;SPAN class=""&gt;"name"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;"WebAccess"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;"essential"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;"parameters"&lt;/SPAN&gt;&lt;SPAN&gt;: [ &lt;/SPAN&gt;&lt;SPAN class=""&gt;"https://*.microsoft.com"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;A href="http://example.com" target="_blank" rel="noopener"&gt;http://example.com&lt;/A&gt;"&lt;/SPAN&gt;&lt;SPAN&gt; ] }&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 06:15:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Getting-Refused-to-load-Scripts-Error-while-running-custom/m-p/3170876#M42056</guid>
      <dc:creator>MonikaGole</dc:creator>
      <dc:date>2023-04-04T06:15:22Z</dc:date>
    </item>
  </channel>
</rss>

