Make cookieconsent run #258
Replies: 2 comments
-
Hi, I got a first solution that runs for me. At least the cookieconsent popup is visible and the buttons work so the cookieconsent-javascript is running. To check correct cookie-handling I have to make some more research. It's not that difficult... I put all the scripts (css and js) together with necessary HTML and executed as internal scripts with ui.html() If someone is interested:
|
Beta Was this translation helpful? Give feedback.
-
I converted this Q&A into an Idea because it would be nice to have support for cookieconsent built into NiceGUI. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, may I ask for some help of the cumminity.
And maybe the solution is a benefit we all can profit from...
In europe and several other contries you need to ask for consence of saving cookies for data privacy reasons.
Otherwise it could be quite expensive to run a public page. So I would like to integrate the cookieconsent javascripts orestbida from https://github.com/orestbida/cookieconsent
I think if we manage to integrate it in nicegui it would be a great help for the whole community to run public pages legally :-)
and also for nicegui-project is having a out-of-the-box GDPR-compliant solution a nice thing I think...
3 files are necessary cookieconsent.css, cookieconsent.js and cookieconsent-init.js
Running code for a javascript solution is:
What I managed in nicegui to get work is: an uploading an external file with injection of html into page, injection and running css-file, example:
External file: test.py, save in directory where main.py is:
code main.py
Code for integrating cookieconsent so far is (to run cookieconsent.js without css-file you have to look for the part 'Make modal by default hidden..' and comment out //* ... */ the following 2 code lines, looks ugly at index.html but works)
main.py
It does not look that much but it was a long journey to get there. Code does not show anything but I think it's there but not visible at least browser tools shows code.
I will go on but maybe is someone here to speed up a little?
Would be so cool - thank you
Markus
cookieconsent-init.js
Beta Was this translation helpful? Give feedback.
All reactions