Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8859847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:09:04+00:00 2026-06-14T15:09:04+00:00

I am trying to modify my web software to use a Content Security Policy.

  • 0

I am trying to modify my web software to use a Content Security Policy. When I compile without it, everything runs fine. When I include CSP headers, Chrome flags an error in two places (using the Chrome developer tools):

  • A “Refused to execute inline script because it violates the Content
    Security Policy…” error in the first line of every ASPX or HTML file –
    even though there is no inline JavaScript!
  • A “Code generation from strings disallowed for this context” error – this is
    noted in the jquery-1.8.3.min.js file but appears to originate from
    some JQuery that I’ve written where I am iterating over data coming
    down from a web service to generate items on the page.

So, two questions: why am I always being told the every file is in violation even if it is just a pure static HTML file?

Second, does content security really mean that I can’t use strings when generating html using JQuery – even when it is in a dedicated .js file? I’ve looked at information all over the web and this particular issue really isn’t addressed. So…what are the rules here?

All I really want is to prevent A) inline JavaScript and B) the loading of external JS files.

Any help would be very much appreciated!

UPDATE: The string errors went away when I upgrade JQuery/JQueryUI to 1.8.2 / 1.9.1. The version that I was using before were only about a month old so this appears to be a recent improvement in JQuery. I can’t be sure that this was JQuery though as I’ve been making other changes as well but it makes sense to be on the more recent JQuery if you can.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:09:05+00:00Added an answer on June 14, 2026 at 3:09 pm

    Content Security Policy blocks eval and eval-like structures (new Function, setTimeout([STRING], ...), etc) by default; they can be just as dangerous as inline script. If you’d like to allow eval, you’ll need to whitelist 'unsafe-eval' as an accepted source of script. That might look like:

    Content-Security-Policy: script-src 'self' 'unsafe-eval' https://script.com
    

    The relevant portion of the spec is http://www.w3.org/TR/CSP/#script-src. http://www.html5rocks.com/en/tutorials/security/content-security-policy/#eval-too might also be helpful.

    Regarding the error messages, I’d suggest using Canary. We’ve improved the error messages significantly in the last month or two; I hope you’ll have a better debugging experience in Stable in the near future. If you’re still getting errors in Canary that don’t give you enough information to debug the problem, please file a bug (http://new.crbug.com/) and post the ID here. I’ll make sure someone looks at it.

    I’m happy to hear you’re experimenting with CSP!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to modify my simple Twisted web proxy to use Proxy-Authentication (username/password) instead
I'm trying to modify my web page, which I currently use QueryStrings to display
Hi I'm trying to modify a web page so that it loads faster. Since
I am trying to modify a python based-authenticator for murmur (voip software) to work
I'm trying to write an interceptor for a web service that will modify the
I'm trying to modify the behavior of some web parts in Sharepoint (thus forcing
I'm trying to modify ps1 script which I found in the web. It should
I'm trying to use a web service to store/retrieve info from a remote SQL
I am trying to modify response from a Web Service using a ClientMessageInspector. At
I'm trying to modify the web.config with powershell to add a smtp section. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.