Skip to content

Commit

Permalink
feature: Hide cookie consent if web page its inside an iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielPalafox committed Jan 9, 2024
1 parent c4c6698 commit 7cc3e26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
></script>
<script type="text/javascript">
function OptanonWrapper() {
const oneTrust = window.document.getElementById('onetrust-consent-sdk')
if (window.location !== window.parent.location && oneTrust) {
oneTrust.style.display = 'none'
}

window.document
.getElementById('onetrust-consent-sdk')
?.setAttribute('data-nosnippet', 'true')
Expand Down

0 comments on commit 7cc3e26

Please sign in to comment.