Magento 2.3.5 - Integration CSP - Slow Pagespeed - Cookie
Hello,
I have a problem with Zoopim integration on Magento 2.3.5.
The issues concern: pagespeed, violation of CSP and cookie
As for CSP
I tried to create a module to try to whitelist the zopim widget (but it doesn't work well)
for the moment, I have disabled the restriction mode (otherwise it would not have loaded the widget)
I created a module in magento by whitelisting:
<?xml version="1.0"?>
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp/etc/csp_whitelist.xsd">
<policies>
<policy id="script-src">
<values>
<value id="zopim1" type="host">*.zdassets.com</value>
<value id="zopim2" type="host">*.zopim.com</value>
<value id="data" type="host">'self' data:</value>
</values>
</policy>
<policy id="default-src">
<values>
<value id="zopim3" type="host">*.zdassets.com</value>
<value id="zopim4" type="host">*.zopim.com</value>
</values>
</policy>
<policy id="img-src">
<values>
<value id="zopim5" type="host">*.zopim.com</value>
<value id="zopim6" type="host">data:</value>
</values>
</policy>
<policy id="connect-src">
<values>
<value id="zopim7" type="host">*.zopim.com</value>
<value id="zopim8" type="host">*.zdassets.com</value>
</values>
</policy>
<policy id="font-src">
<values>
<value id="zopim9" type="host">data:</value>
<value id="zopim10" type="host">*.zopim.com</value>
</values>
</policy>
<policy id="frame-src">
<values>
<value id="zopim11" type="host">*.zdassets.com</value>
<value id="zopim12" type="host">*.zopim.com</value>
</values>
</policy>
</policies>
</csp_whitelist>
As for speed, as soon as I enable the module, the pagespeed score drops a lot.currently magento is in developer mode and is still under development, however this widget penalizes a lot.
as for cookies, I would need that once you click on the "accept cookies" button ( id="btn-cookie-allow" ) the widget loads.
Could anyone help me? I'm really in trouble and I wouldn't want to give up zopim.
thank you all in advance!
(I hope this post is also useful to other users who are struggling with magento integration.)
Please sign in to leave a comment.
0 Comments