2
0
mirror of https://github.com/offen/website.git synced 2024-11-22 17:10:29 +01:00

Fix link, load consent script with async tag

This commit is contained in:
Frederik Ring 2022-06-16 15:25:08 +02:00
parent 928f8f88d0
commit 1746abb6b0

View File

@ -58,8 +58,13 @@ Well, we have developed a tool for these needs. Say hello and give it a try. We
<div class="tweet-container mb4"> <div class="tweet-container mb4">
</div> </div>
<script src="https://consent.offen.dev/client.js"></script> <script async src="https://consent.offen.dev/client.js"></script>
<script> <script>
const waitFor = window.setInterval(() => {
if (!window.ConsentClient) {
return
}
window.clearInterval(waitFor)
const client = new window.ConsentClient({ const client = new window.ConsentClient({
host: document.querySelector('.consent-container'), host: document.querySelector('.consent-container'),
ui: { ui: {
@ -72,8 +77,9 @@ Well, we have developed a tool for these needs. Say hello and give it a try. We
.then(function (result) { .then(function (result) {
if (result && result.decisions && result.decisions.twitter) { if (result && result.decisions && result.decisions.twitter) {
const blockquote = document.createElement('div') const blockquote = document.createElement('blockquote')
blockquote.innerHTML = '<blockquote class="twitter-tweet"><a href="https://twitter.com/hioffen/status/1510854517092491270?ref_src=twsrc%5Etfw"></a></blockquote>' blockquote.classList.add('twitter-tweet')
blockquote.innerHTML = '<a href="https://twitter.com/hioffen/status/1510854517092491270?ref_src=twsrc%5Etfw"></a>'
document.querySelector('.tweet-container').appendChild(blockquote) document.querySelector('.tweet-container').appendChild(blockquote)
const script = document.createElement('script') const script = document.createElement('script')
@ -84,6 +90,7 @@ Well, we have developed a tool for these needs. Say hello and give it a try. We
.catch(function (err) { .catch(function (err) {
console.error(err) console.error(err)
}) })
}, 7)
</script> </script>
The *Offen Consent Tool* keeps your data footprint small by never storing data about consent decisions on your end. As a lightweight solution for managing user consent on websites, it focuses on these objectives: The *Offen Consent Tool* keeps your data footprint small by never storing data about consent decisions on your end. As a lightweight solution for managing user consent on websites, it focuses on these objectives:
@ -103,7 +110,7 @@ The *Offen Consent Tool* is using 1st Party Cookies to store user's consent dec
Next deploy the application to a domain like `consent.example.com`. On the host site `www.example.com` embed the client script: Next deploy the application to a domain like `consent.example.com`. On the host site `www.example.com` embed the client script:
```jsx ```jsx
<script src="[https://consent.example.com/client.js](https://consent.example.com/client.js)"> <script src="https://consent.example.com/client.js">
``` ```
which exposed `window.ConsentClient`. In your client side code, construct a new client instance pointing at your deployment and request user consent for the desired scope(s): which exposed `window.ConsentClient`. In your client side code, construct a new client instance pointing at your deployment and request user consent for the desired scope(s):