Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RanjitBShinde opened this issue Mar 25, 2024 · 6 comments
Assignees
Labels
bug Something isn't working Progress: PR review

Comments

@RanjitBShinde
Copy link

RanjitBShinde commented Mar 25, 2024

  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.
@RanjitBShinde RanjitBShinde added the bug Something isn't working label Mar 25, 2024
Copy link

m2-assistant bot commented Mar 25, 2024

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.

@glo82145 glo82145 assigned glo82145 and unassigned glo82145 Apr 2, 2024
@glo85315 glo85315 self-assigned this Apr 2, 2024
@glo85315
Copy link
Collaborator

glo85315 commented Apr 5, 2024

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 RanjitBShinde changed the title [bug]: Unable to execute javascript tags which added in block [bug]: Unable to execute javascript tags which added in block in PWA Venia Apr 5, 2024
@RanjitBShinde
Copy link
Author

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

@glo42707
Copy link
Contributor

@adobe export issue to JIRA project PWA as Bug

@github-jira-sync-bot
Copy link

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

@glo85315
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Progress: PR review
Projects
None yet
Development

No branches or pull requests

5 participants