1

I am trying to use my Content-Security-Policy for Internet Explorer

Here's the Content-Security-Policy I have:

<meta http-equiv="Content-Security-Policy" content="default-src 'self'">

This is what I've added for X-Content-Security-Policy

<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'">

I see loads of inline styles warnings (and others) when I open my document using MS Edge, Firefox, or Chrome. But I don't see anything in IE. And I can still run scripts on the page in IE, which I can't do (and want to prevent) on the other browsers I mentioned.

So this makes me wonder: Am I using the X-Content-Security-Policy meta tag correctly? If not, how do I fix my tag? And also, where can I find documentation for X-Content-Security-Policy? I've searched on X-Content-Security-Policy... I haven't been able to find anything. The things that come up are for Content-Security-Policy

<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="X-Content-Security-Policy" content="default-src 'self'"><meta http-equiv="Content-Security-Policy" content="default-src 'self'"> <script src="./jquery-3.3.1.min.js" type="text/javascript"></script> <script> alert('boo'); </script> </head> <body> Hello World </body> </html> 

1 Answer 1

2

CSP is only partial supported in IE10-11. You can see in the browser compatibility, it doesn't support <meta> element in IE. And partial support means it only supports the 'sandbox' directive by using the X-Content-Security-Policy header. For more details, you can also check this thread.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you your answer and the link are very informative

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.