Skip to content

Commit

Permalink
Try to remove unsafe-inline
Browse files Browse the repository at this point in the history
  • Loading branch information
SAPikachu committed Jan 29, 2022
1 parent a6febbb commit 03f12b1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
REACT_APP_VERSION=$COMMIT_REF
REACT_APP_VERSION=$COMMIT_REF
INLINE_RUNTIME_CHUNK=false
25 changes: 0 additions & 25 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,6 @@
<head>
<meta charset="utf-8" />
<meta name="google" content="notranslate">
<!-- Google Analytics -->
<script>
window.__loadGa = function () {
if (window.ga) {
return ga;
}
(function (i, s, o, g, r, a, m) {
i["GoogleAnalyticsObject"] = r;
(i[r] =
i[r] ||
function () {
(i[r].q = i[r].q || []).push(arguments);
}),
(i[r].l = 1 * new Date());
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
})(window, document, "script", "https://www.google-analytics.com/analytics.js", "ga");

ga("create", "UA-155269742-1", "auto");
return ga;
};
</script>
<!-- End Google Analytics -->
<meta name="referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="theme-color" content="#000000" />
Expand Down
25 changes: 25 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/* eslint-disable */
// @ts-nocheck
window.__loadGa = function () {
if (window.ga) {
return ga;
}
(function (i, s, o, g, r, a, m) {
i["GoogleAnalyticsObject"] = r;
(i[r] =
i[r] ||
function () {
(i[r].q = i[r].q || []).push(arguments);
}),
(i[r].l = 1 * new Date());
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
})(window, document, "script", "https://www.google-analytics.com/analytics.js", "ga");

ga("create", "UA-155269742-1", "auto");
return ga;
};
/* eslint-enable */

const init = () => import(/* webpackMode: "eager" */ "./bootstrap");

if (!Object.values || !window.URLSearchParams || !window.fetch) {
Expand Down
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{
"src": "/(.*)",
"headers": {
"Content-Security-Policy-Report-Only": "default-src *; script-src 'self' 'unsafe-inline' https://*.sapk.ch https://*.statuspage.io https://www.google-analytics.com; script-src-elem 'self' 'unsafe-inline' https://*.sapk.ch https://*.statuspage.io https://www.google-analytics.com; style-src * 'unsafe-inline'; style-src-elem * 'unsafe-inline'; style-src-attr * 'unsafe-inline'; report-to https://amaekoromo.report-uri.com/r/d/csp/reportOnly"
"Content-Security-Policy-Report-Only": "default-src *; script-src 'self' https://*.sapk.ch https://www.google-analytics.com https://*.statuspage.io; script-src-elem 'self' https://*.sapk.ch https://www.google-analytics.com https://*.statuspage.io; style-src * 'unsafe-inline'; style-src-elem * 'unsafe-inline'; style-src-attr * 'unsafe-inline'; report-to https://amaekoromo.report-uri.com/r/d/csp/reportOnly"
},
"dest": "/index.html"
}
Expand Down

1 comment on commit 03f12b1

@vercel
Copy link

@vercel vercel bot commented on 03f12b1 Jan 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.