How to fix Magento 2 CSP Warnings

What is CSP full form and what does it do ? CSP full form is Content Security Policies (CSP) and here in this article, we will learn how to fix Magento 2 CSP warnings using a custom module. It is a powerful tool to mitigate against Cross Site Scripting (XSS) and related attacks, including card …

How to pass PHP variables from phtml files to RequireJs in Magento 2?

In Magento 2, we can use Declarative notation to pass dynamic PHP values to RequireJs from template files. Magento templates support <script type=”text/x-magento-init”> … </script> tag to fulfill this requirement. First, create a module e.g. Webiins_ExitPopup and add a file exitpopup.phtml at location app/code/Webiins/ExitPopup/view/frontend/templates to add declarative notation: We can access these parameters in app/code/Webiins/ExitPopup/view/frontend/web/js/exitpopup.js …