magento / pwa-studio

🛠Development tools to build, optimize and deploy Progressive Web Applications for Magento 2.
https://developer.adobe.com/commerce/pwa-studio/
Open Software License 3.0
1.06k stars 682 forks source link

[bug]: Unable to execute javascript tags which added in block in PWA Venia #4245

Closed RanjitBShinde closed 2 months ago

RanjitBShinde commented 5 months ago
  1. Login to Magento Admin
  2. Create or Edit block, add html element and add any javascript in that
  3. Add that block in footer or somewhere in page
  4. Goto PWA Venia frontend and check, javascript is loading but it is not executable.
m2-assistant[bot] commented 5 months ago

Hi @RanjitBShinde. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information. Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

glo85315 commented 5 months ago

Hi

  1. Login to Magento Admin

  2. Click create page, add html element Button and add script tag and inside script add click button functionality

  3. Goto PWA local fronend and check, button is displaying but click button functionality not working , it means script not working

  4. Issue is producible in PWA

But

  1. Login to Magento Admin
  2. Click create page, add html element Button and add script tag and inside script add click button functionality
  3. After create page there is 3 options .delete ,edit, view
  4. When we click view option
  5. Page is open in another window. button is displaying click button functionality is working fine
  6. Issue is not producible from Magento Admin
RanjitBShinde commented 5 months ago

@glo85315 in luma theme it works. Issue is about PWA venia.

glo42707 commented 4 months ago

@adobe export issue to JIRA project PWA as Bug

github-jira-sync-bot commented 4 months ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/PWA-3260 is successfully created for this GitHub issue.

glo85315 commented 3 months ago

Hi @RanjitBShinde , Thank you for reaching out to us regarding the JavaScript execution issue with Magento's PWA Venia storefront. After thorough investigation, we've discovered that React's security measures prevent the execution of JavaScript within static blocks, as it sanitizes HTML content, including script tags.

Unfortunately, due to this limitation within the React framework, we regret to inform you that we won't be able to proceed with your ticket as originally anticipated. We understand the importance of this functionality to you and apologize for any inconvenience this may cause.

If you have any further questions or concerns, please don't hesitate to reach out to us. We're here to help in any way we can.

glo82145 commented 2 months ago

As we have no update on this ticket for more than 14 days , Hence we are closing this ticket. Please feel free to reopen in case of any update.