Skip to content

Commit

Permalink
clear-cookies.js script
Browse files Browse the repository at this point in the history
  • Loading branch information
bgalek committed Feb 22, 2024
1 parent ec11094 commit 1f92478
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ const HomePage: React.FunctionComponent<HomePageProps> = ({posts, jobs, events,
document.body.appendChild(script);
}, []);

const clearCookies = "document.cookie.split(\";\").forEach(function(c) { document.cookie = c.replace(/^ +/, \"\").replace(/=.*/, \"=;expires=\" + new Date().toUTCString() + \";path=/\"); });";

return (
<React.Fragment>
<Head>
Expand All @@ -50,7 +48,7 @@ const HomePage: React.FunctionComponent<HomePageProps> = ({posts, jobs, events,
<link rel="preload" href="images/splash.jpg" as="image"/>
<link rel="author" href="humans.txt"/>
<script defer data-domain="allegro.tech" src="https://plausible.io/js/script.js"></script>
<script type="text/javascript">{clearCookies}</script>
<script defer src="/clear-cookies.js"></script>
</Head>
<Header/>
<Container className="m-padding-top-24">
Expand Down
2 changes: 2 additions & 0 deletions public/clear-cookies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// just to clean up old google cookies, remove this in few months
document.cookie.split(";").forEach(function(c) { document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); });

0 comments on commit 1f92478

Please sign in to comment.