-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dropping of custom scripts in AMP mode (#6830)
Drops user `<script>` tags and shows a warning in AMP mode. Right now they are only dropped in production mode and left in dev mode so the validator shows its warning since it looks like conflicting props log messages are being cleared causing them to not show. Closes: #6688
- Loading branch information
1 parent
b6b0db1
commit 26a4eb8
Showing
3 changed files
with
25 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
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,13 @@ | ||
import Head from 'next/head' | ||
|
||
export default () => ( | ||
<div> | ||
<Head> | ||
<script src='/im-not-allowed.js' type='text/javascript' /> | ||
<script dangerouslySetInnerHTML={{ | ||
__html: `console.log("I'm not either :p")` | ||
}} /> | ||
</Head> | ||
<p>We only allow AMP scripts now</p> | ||
</div> | ||
) |
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