0

I want to include a file into the Browser console.

I have used

document.write("<script src='https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-3.5.0.debug.js'></script>");

but i get this error:

Refused to load the script '...' because it violates the following Content Security Policy directive: "script-src 'nonce-74eCu_hm3_B6K5S7B4_qbQ' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:". Note that 'strict-dynamic' is present, so host-based allowlisting is disabled. Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

Is their any way to paste a JS file link into the browser console?

Manue
  • 1
  • `document.write()` has nothing to do with the console. – Barmar Sep 04 '22 at 18:42
  • @Barmar OP probably tries to load some script onto the site from the dev tools – Konrad Sep 04 '22 at 18:44
  • You could try `document.createElement('script')`, but I suspect you'll run into the same CSP error. – Barmar Sep 04 '22 at 18:46
  • do you own the site you are trying to do this on? If so, update the content securty policy appropriately. If not, you're out of luck. If you don't know [what a content security policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) is, go read up on it. – starball Sep 05 '22 at 05:35

0 Answers0