Open
Description
Summary
Preconditions and environment
Getting a console error in all magento environment in version 2.4.6
Steps to reproduce
Fresh Install of M2.4.6 in environment as above
Login to backend
Nav to Admin>Marketing>Email Templates>click preview
Open developer options and you can able to find a error in the console.
Bocked script execution in 'http://localmagento/index.php/admin/admin/email_template/popup/key/53379463b63d4ed7911eaf8d8aa133d7f186826b20ecfbf01cf5d5ec5c8e349f/' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
Examples
We checked the code and found this phtml under the path
vendor/magento/module-email/view/adminhtml/templates/preview/iframeswitcher.phtml
Proposed solution
<iframe name="preview_iframe"
id="preview_iframe"
frameborder="0"
title="<?= $block->escapeHtmlAttr(__('Preview')) ?>"
width="100%"
sandbox="allow-same-origin allow-pointer-lock"
></iframe>
In the above code snippet you can find sandbox attribute, In which if we add allow-scripts value with other allow-same-origin and allow-pointer-lock. After adding the allow scripts the console error is not occuring in the preview templates.
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.