Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat]: Parse again function for dynamic Html component #590

Closed
gitVasile opened this issue Nov 3, 2023 · 6 comments
Closed

[Feat]: Parse again function for dynamic Html component #590

gitVasile opened this issue Nov 3, 2023 · 6 comments

Comments

@gitVasile
Copy link

gitVasile commented Nov 3, 2023

Description

If I add the piece of code below in my DOM dynamically, the cookieconsent will never be able to parse this new code because it was added after the loaded.

<script type="text/plain" data-cookiecategory="optional" lang="js">alert('ok')</script>

Proposed solution

We should maybe add a way to parse the code again using a mehtod from you api.

Additional details

Thank you

@gitVasile gitVasile added the enhancement New feature or request label Nov 3, 2023
@github-actions github-actions bot added the triage yet to be reviewed label Nov 3, 2023
@orestbida orestbida removed enhancement New feature or request triage yet to be reviewed labels Nov 4, 2023
@orestbida
Copy link
Owner

orestbida commented Nov 4, 2023

@gitVasile, you can use the .updateScripts() method to let the plugin know of the newly added script tags.

@gitVasile
Copy link
Author

Hey @orestbida ok, but why about iframe newly added for example? Is updateScripts() parsing all the elements?

Thank you

@orestbida
Copy link
Owner

Unfortunately no, the plugin only handles scripts.

@gitVasile
Copy link
Author

Ok, no problem. Thank you for your time and project 👍 .

@orestbida
Copy link
Owner

@gitVasile I forgot to mention as I was in a hurry, but there's a dedicated plugin to handle iframes, called iframemanager, although it too does not handle dynamically injected iframes.

@gitVasile
Copy link
Author

Hey @orestbida Thank you for your help. Should be fine.

Have a nice day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants