legacy-knowledge-base
Publicado Jul. 25, 0002

Remove the Ability to Add JavaScript in the Control Panel's Site Pages

written-by

Justin Choi

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

Issue

  • Disable the ability to add JavaScript to pages on DXP 7.0 and thus prevent malicious code injections.

js-available.png

Environment 

  • DXP 7.0 Fix Pack 60+
  • This functionality was introduced in DXP 7.0 Fix Pack 60

Resolution

  1. Install DXP 7.0 Fix Pack 60 or higher.
  2. In the portal-ext.properties, add the following properties -
    1. field.enable.com.liferay.portal.kernel.model.Layout.javascript=false
    2. field.enable.com.liferay.portal.kernel.model.LayoutSet.javascript=false
  3. Start the application server.
  4. Navigate to the Configure Page menu by clicking Control Panel > Navigation > 3-dot icon > Configure Page next to any page (public or private).

At this point, the ability to add JavaScript is no longer available.

js-disabled.png

 

 

did-this-article-resolve-your-issue

legacy-knowledge-base