Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
hello everyone,
I need your help.
I use jQuery.js to get an *.json file,like this:
$.get("https://echarts.apache.org/examples/data/asset/geo/USA.json",
function (json) {
console.log('JSON Data:',json);
}
);
and I get error message in Web Console:
jquery.js:10099 Refused to connect to 'https://echarts.apache.org/examples/data/asset/geo/USA.json' because it violates the following Content Security Policy directive: "default-src https://app.powerbi.cn data: blob: 'unsafe-inline' 'unsafe-eval'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.
How can i do ?
Thank you very much
Best regards
Solved! Go to Solution.
Hi @luojiandanPBI,
You will need to amend your privileges in your visual capabilities to allow web access from within the visual. Setting the domain you need should suffice, e.g.:
{
...
"privileges": [
{
"name": "WebAccess",
"essential": true,
"parameters": [ "https://echarts.apache.org" ]
}
],
...
}
This may not be exactly right but should help you move forward.
Note that the endpoint may have restrictions on accessing sandboxed iframes (which is how custom visuals are hosted). If this is the case, then you will need to check with the site owner if they can change their cross-domain policies (but bear in mind that site owners are usually reluctant to do this).
Regards,
Daniel
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi,Daniel,you are right.
github is ok.
"https://*.githubusercontent.com"
Thanks again.
Hi @luojiandanPBI,
You will need to amend your privileges in your visual capabilities to allow web access from within the visual. Setting the domain you need should suffice, e.g.:
{
...
"privileges": [
{
"name": "WebAccess",
"essential": true,
"parameters": [ "https://echarts.apache.org" ]
}
],
...
}
This may not be exactly right but should help you move forward.
Note that the endpoint may have restrictions on accessing sandboxed iframes (which is how custom visuals are hosted). If this is the case, then you will need to check with the site owner if they can change their cross-domain policies (but bear in mind that site owners are usually reluctant to do this).
Regards,
Daniel
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi,Daniel,you are right.
github is ok.
"https://*.githubusercontent.com"
Thanks again.
Do you prove chatgtp?
thanks for reply.
I try:
but i don't know how to set 'connect-src' in my files.