-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Ist there a way to re-run? #48
Comments
+1 on this. Facing the exact same issue. Running a combination of cc.reset();
cc.run(cookieConsentConfig);
manager.run(managerConfig); on each dynamic page load works, but only if the user clicks the "Load once" button. Clicking "Don't ask again" breaks the script. This probably also has to do with the CookieConsent |
I create the hotfix this issue. When a page change occurs in react / next.js, it does not detect DOM changed. My solution reset and re-run iframemanager at each page change. PR #55 import { useRouter } from 'next/router'
...
useEffect(() => {
// const cc = initCookieConsent()
const im = iframemanager()
setTimeout(() => {
im.run(...)
}, 1000) // Since it is not SSR, it is necessary to allow time for the client to render it
return () => {
im.reset() // stop observers, reset scoped variables
}
}, [router.asPath])
... |
You can now reset and re-run the plugin in v1.3.0: im.run(config);
// dom is modified ...
im.reset(true); //hard reset
im.run(config) |
Hi,
i am loading some video portfolios via ajax on an wordpress theme. Is there a way to re-run the script to detect the that are new to the dom?
Thanks for your help!
Cheers
Tobias
The text was updated successfully, but these errors were encountered: