This course is sponsored by M.academy, the simplest way to master Magento.
This Google Chrome browser plugin makes it easy to create csp_whitelist.xml
files for Magento. By simply installing the plugin and browsing the pages of your site, the plugin will automatically generate a whitelist of URLs that can be used to create a csp_whitelist.xml
file for your Magento 2 site.
Setting up csp_whitelist.xml
files can be confusing and time-consuming. This module makes it very easy to generate a whitelist of these URLs. It's also possible that manually creating a csp_whitelist.xml
file can be error-prone. This module helps to avoid these errors by automatically generating the whitelist for you.
Install the browser plugin from the Google Chrome Web Store.
See the video about how to use this CSP plugin on YouTube.
Simply browse to the main pages of your Magento site (home page, category page, product page, shopping cart page, and checkout page) one-by-one. Click the Scan Current Page for each page, check the box to confirm that you scanned it, and then proceed with the next page, repeating the process until you've scanned all pages. Note that you can also scan pages that are not listed here, such as CMS pages, custom pages, or any other pages that are unique to your site which may contain external scripts.
Once you've scanned all pages, click the Complete & Generate button. This will generate a complete csp_whitelist.xml
file, which you can then copy over to your Magento 2 site.
For more information, see the extended documentation.