unsupported-csp-referrer-directive.html (1197B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Referrer Policy: CSP 'referrer' directive should not be supported</title> 5 <meta http-equiv="Content-Security-Policy" content="referrer no-referrer"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <!-- Common global functions for referrer-policy tests. --> 9 <script src="/common/security-features/resources/common.sub.js"></script> 10 </head> 11 <body> 12 <h1>Referrer Policy: CSP 'referrer' directive should not be supported</h1> 13 <p>CSP used to have a 'referrer' directive to set a Referrer Policy. This directive has been removed and should not be supported.</p> 14 15 <pre id="received_message">Running...</pre> 16 17 <script> 18 promise_test(function() { 19 var urlPath = '/common/security-features/subresource/image.py?cache_destroyer=' + (new Date()).getTime(); 20 return requestViaImage(urlPath, null, 'always') 21 .then(function(message) { 22 assert_equals(message.referrer, document.location.href); 23 }); 24 }, "Image has a referrer despite CSP 'referrer' directive"); 25 </script> 26 27 <div id="log"></div> 28 </body> 29 </html>