Skip to content

Commit e7675a0

Browse files
committed
chore: Remove CSP nonce
1 parent 7905e3e commit e7675a0

23 files changed

Lines changed: 47 additions & 74 deletions

templates/_base-layout.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,18 @@
1414
<link rel="preload" href="https://assets.ubuntu.com/v1/9689339a-snapcraft-hero-background--light.png" as="image">
1515

1616
<!-- Google Tag Manager -->
17-
<script nonce="{{ CSP_NONCE }}">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
17+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
1818
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
1919
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
20-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;var n=d.querySelector('[nonce]');
21-
n&&j.setAttribute('nonce',n.nonce||n.getAttribute('nonce'));f.parentNode.insertBefore(j,f);
20+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
2221
})(window,document,'script','dataLayer','GTM-KCGXHQS');</script>
2322
<!-- End Google Tag Manager -->
2423

2524
{{ vite_import('static/sass/styles.scss') }}
2625

2726
{{ vite_import('static/js/base/base.ts') }}
2827
{% block scripts_includes %}{% endblock %}
29-
<script src="https://assets.ubuntu.com/v1/703e23c9-lazysizes+noscript+native-loading.5.1.2.min.js" defer nonce="{{ CSP_NONCE }}"></script>
28+
<script src="https://assets.ubuntu.com/v1/703e23c9-lazysizes+noscript+native-loading.5.1.2.min.js" defer></script>
3029

3130
<meta name="description" content="{% block meta_description %}Snaps are containerised software packages that are simple to create and install. They auto-update and are safe to run. And because they bundle their dependencies, they work on all major Linux systems without modification.{% endblock %}">
3231
<meta name="copydoc" content="{% block meta_copydoc %}{% endblock %}">
@@ -81,14 +80,14 @@
8180

8281
{% block scripts %}{% endblock %}
8382

84-
<script nonce="{{ CSP_NONCE }}">
83+
<script>
8584
window.COMMIT_ID = "{{ COMMIT_ID }}";
8685
window.ENVIRONMENT = "{{ ENVIRONMENT }}";
8786
window.SENTRY_DSN = "{{ SENTRY_DSN }}";
8887
window.ANALYTICS_ENDPOINT = "{{ ANALYTICS_ENDPOINT }}";
8988
</script>
9089

91-
<script type="application/ld+json" nonce="{{ CSP_NONCE }}">
90+
<script type="application/ld+json">
9291
{
9392
"@context": "http://schema.org/",
9493
"@id": "https://snapcraft.io/#organization",
@@ -107,7 +106,7 @@
107106
}
108107
</script>
109108

110-
<script type="application/ld+json" nonce="{{ CSP_NONCE }}">
109+
<script type="application/ld+json">
111110
{
112111
"@context": "http://schema.org",
113112
"@id": "https://snapcraft.io/#website",

templates/_layout-embedded.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
{% block scripts %}{% endblock %}
4747

48-
<script type="application/ld+json" nonce="{{ CSP_NONCE }}">
48+
<script type="application/ld+json">
4949
{
5050
"@context": "http://schema.org/",
5151
"@id": "https://snapcraft.io/#organization",

templates/about/publish.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ <h3 class="p-heading--5">Trave CI, Circle CI and GitHub Actions are all supporte
196196
{% endblock %}
197197

198198
{% block scripts %}
199-
<script nonce="{{ CSP_NONCE }}">
199+
<script>
200200
window.addEventListener("DOMContentLoaded", function () {
201201
try {
202202
snapcraft.about.initFSFLanguageSelect(document.querySelector('.js-fsf-language-select'));

templates/admin/admin.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div id="root">
77
</div>
88

9-
<script nonce="{{ CSP_NONCE }}">
9+
<script>
1010
window.CSRF_TOKEN = "{{ csrf_token() }}";
1111
window.SENTRY_DSN = "{{ SENTRY_DSN }}";
1212
window.API_URL = "{{ api_url }}";

templates/blog/article.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% endif %}
1010

1111
{% block meta_schema %}
12-
<script type="application/ld+json" nonce="{{ CSP_NONCE }}">
12+
<script type="application/ld+json">
1313
{
1414
"@context": "http://schema.org",
1515
"@id": "https://snapcraft.io/#article",
@@ -98,7 +98,7 @@ <h4>
9898
</section>
9999
{% endif %}
100100

101-
<script type="text/template" id="blog-series-item-template" nonce="{{ CSP_NONCE }}">
101+
<script type="text/template" id="blog-series-item-template">
102102
<li class="p-list__item">
103103
<h5>
104104
<a href="/blog/${slug}" class="p-blog-list__item ${className}">
@@ -114,7 +114,7 @@ <h5>
114114
{% endblock %}
115115

116116
{% block scripts %}
117-
<script nonce="{{ CSP_NONCE }}">
117+
<script>
118118
window.addEventListener("DOMContentLoaded", function() {
119119
try {
120120
{% if is_in_series %}

templates/blog/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ <h5 class="p-notification__title">Success</h5>
148148
{% endblock %}
149149

150150
{% block scripts %}
151-
<script nonce="{{ CSP_NONCE }}">
151+
<script>
152152
window.addEventListener("DOMContentLoaded", function() {
153153
try {
154154
{% if categories %}

templates/docs/document.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ <h4 class="p-table-of-contents__header">On this page</h4>
161161
{% endblock %}
162162

163163
{% block scripts %}
164-
<script nonce="{{ CSP_NONCE }}">
164+
<script>
165165
window.addEventListener("DOMContentLoaded", function() {
166166
try {
167167
// Based on Vanilla side navigation example

templates/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ <h2>Measure user growth</h2>
164164
{{ vite_import('static/js/public/homepage.ts') }}
165165
{{ vite_import('static/js/public/featured-snaps.ts') }}
166166
{% if nps %}
167-
<script src="//app-sjg.marketo.com/js/forms2/js/forms2.min.js" defer nonce="{{ CSP_NONCE }}"></script>
167+
<script src="//app-sjg.marketo.com/js/forms2/js/forms2.min.js" defer></script>
168168
{% endif %}
169169
{% endblock %}
170170

171171
{% block scripts %}
172-
<script nonce="{{ CSP_NONCE }}">
172+
<script>
173173
window.addEventListener("DOMContentLoaded", function () {
174174
try {
175175
snapcraft.public.homepage.initFSFLanguageSelect();

templates/partials/_video.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<div id="asciicastplayer"></div>
1616
{% endif %}
1717

18-
<script nonce="{{ CSP_NONCE }}">
18+
<script>
1919
document.addEventListener("DOMContentLoaded", function() {
2020
const vimeoplayerFrame = document.getElementById("vimeoplayer");
2121
const asciicastplayerFrame = document.getElementById("asciicastplayer");

templates/publisher/collaboration.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
{% block content %}
88
<main id="main-content"></main>
9-
<script nonce="{{ CSP_NONCE }}">
9+
<script>
1010
window.SENTRY_DSN = "{{ SENTRY_DSN }}";
1111
window.CSRF_TOKEN = "{{ csrf_token() }}";
1212
window.data = JSON.parse({{ collaborations_data|tojson }});

0 commit comments

Comments
 (0)