feat: add onMessage to activate cookies
A les pagines del WP que contenen iframe que apunta a somoffice, funcio per enviar missatge via iframe-resizer(https://github.com/davidjbradshaw/iframe-resizer/blob/master/docs/parent_page/methods.md#sendmessagemessage-targetorigin):
<script> jQuery(document).ready(function () { let decodedCookie = decodeURIComponent(document.cookie); console.log(document.cookie) let is_analytics = decodedCookie.indexOf("_clck") != -1; let is_advertising = decodedCookie.indexOf("_ga") != -1; jQuery("#framecontainer iframe")[0].iFrameResizer.sendMessage( '{"somconnexio_wp_cookies": {"is_analytics": ' + is_analytics + ', "is_advertising": ' + is_advertising + "}}" ); }); </script>
Al index.html del somoffice, per defecte cookies sense permisos. Si des de WP ens arriben els permisos habilitem cookies.