-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1578 from cramforce/csp-test
Add example page for testing the CDN CSP.
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!doctype html> | ||
<html ⚡> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>AMP Analytics</title> | ||
<link rel="canonical" href="analytics.amp.html" > | ||
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> | ||
|
||
<meta http-equiv="Content-Security-Policy" content="default-src * data:; script-src https://cdn.ampproject.org/v0.js https://cdn.ampproject.org/v0/ https://cdn.ampproject.org/viewer/; object-src 'none'; style-src 'unsafe-inline' https://fast.fonts.net https://fonts.googleapis.com; report-uri https://csp-collector.appspot.com/csp/amp"> | ||
<link href='https://fonts.googleapis.com/css?family=Questrial' rel='stylesheet' type='text/css'> | ||
<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script> | ||
<script async custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js"></script> | ||
<style>body {opacity: 0}</style><noscript><style>body {opacity: 1}</style></noscript> | ||
<script async src="https://cdn.ampproject.org/v0.js"></script> | ||
|
||
<style amp-custom> | ||
#data-svg { | ||
width: 100px; | ||
height: 100px; | ||
background-color: red; | ||
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="#fff" viewBox="0 0 18 18"><path d="M15 8.25H5.87l4.19-4.19L9 3 3 9l6 6 1.06-1.06-4.19-4.19H15v-1.5z" /></svg>') | ||
} | ||
.font { | ||
font-family: 'Questrial' | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
To update, copy current Proxy CSP into meta tag. This file intentionally does not validate, because it uses an inline CSP. Note also, that one CSP error related to the "livereload" script injected by our test server is expected. | ||
|
||
<h2>Should show red with arrows</h2> | ||
<div id="data-svg"></div> | ||
|
||
<h2 id="iframe">Should say hello world</h2> | ||
<amp-iframe width="300" height="50" src="data:text/html;charset=utf-8;base64,PGgxPmhlbGxvIHdvcmxkPC9oMT4="> | ||
<amp-img placeholder src="img/hero@1x.jpg" width="300" height="50"> | ||
</amp-iframe> | ||
|
||
<h2>Should show ad<h2> | ||
<amp-ad width=300 height=250 | ||
type="a9" | ||
data-aax_size="300x250" | ||
data-aax_pubname="test123" | ||
data-aax_src="302"> | ||
</amp-ad> | ||
<h2>Should show YT video</h2> | ||
<amp-youtube | ||
data-videoid="mGENRKrdoGY" | ||
width="240" height="135"></amp-youtube> | ||
<h2>Should show image</h2> | ||
<amp-img src="https://cdn.ampproject.org/i/s/i.guim.co.uk/img/media/dc4d6f2e1198a804b9c9d4b70515a8f7915e1943/0_0_6144_3688/master/6144.jpg?w=700&q=85&auto=format&sharp=10&s=e13bbb3b723ce2d831869edc96ec4b96" width=50 height=50></amp-img> | ||
|
||
<h2 class="font">Different font</h2> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters