Skip to content

CSP directive error in tensorboard plugin #5828

Open
@ameypatelNvidia

Description

@ameypatelNvidia

Hi,

I am using tensorboard to create a plugin so that I can render custom charts. I wish to use Chart.JS to add this feature and need to add a script to be able to use it. I do so by calling the loadScript function here in the example plugin.

However, I get Refused to load the script 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'sha256-PVZp/wXI2V6hq7T2aNiDNM+vJWIOWwNwyhE53i+6lSQ='". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

function loadScript() {
  const script = document.createElement('script');
  script.src = "https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.js";
  document.body.appendChild(script);
  console.log("I am here...Trying to load ", url);
}

Is there a better way to plot custom charts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions