Replies: 1 comment
-
I'm not sure I understand what the issue is. Why are you manually firing the By default the plugin will load with a low priority, to avoid having a significant impact on page loading speed. This is the behaviour of all scripts with the attribute <script type="module" src=".."></script> // wait page load
<script defer src=".."></script> // wait page load You can make the plugin load with a higher priority by using the UMD variant and by setting the <script src="cookieconsent.umd.js"></script>
<script src="cookieconsent-init.js">
CookieConsent.run({
lazyHtmlGeneration: false,
...
}};
</script> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was asked to add an external JS provided by Jira. It was consented and loaded properly, but the button that should show a chat didn't show up. However, the JS provided by Jira itself was correct, the relevant asset is loaded.
I found out (trial and error) that the script waits for
DOMContentLoaded
. So I set a timeout to fire the DOMContentLoaded-Event. Unfortunately, I have to set a timeout which accidentally solves it - if the JavaScript added to the DOM will be loaded just early enough.This is the relevant CookieConsent configuration part.
Is there any better way to solve this? As you can see, I understand some basics but my daily business is neither JavaScript nor Browser behaviour and underlying concepts. So yes, can you rewrite it so I can learn from it?
Beta Was this translation helpful? Give feedback.
All reactions