Skip to content

Modern CEWP 1.0.0.7

Latest

Choose a tag to compare

@SPJS SPJS released this 22 Nov 09:38

Install or upgrade

  1. Download modern-cewp.sppkg below.
  2. Upload it to your tenant App Catalog, replacing the previous version.
  3. Existing web parts pick up the new version automatically. The version is shown in the web part in edit mode and at the top of the property pane, so you can check which version is active.

Content Security Policy (CSP)

SharePoint Online now enforces a Content Security Policy. Check your content for the following:

  • External scripts (for example from a CDN) only load if their domain is added to Trusted script sources in the SharePoint admin center. Scripts stored in your own tenant work as before.
  • Inline event handlers such as onclick="..." and javascript: links are blocked by SharePoint and will not work. Attach handlers with addEventListener in a script instead. The web part now shows a warning in edit mode if your content contains these.

See the README for details and an example.

Changes

  • Fixed loading of HTML files that reference external stylesheets with <link rel="stylesheet">. Relative stylesheet and script URLs are now resolved against the linked HTML file.
  • Inline scripts run in the global scope again, so functions and variables declared in one script can be used from other scripts.
  • Script blocks that are not JavaScript (templates, JSON) are no longer run, and stay in the HTML so your code can read them.
  • Warns about inline event handlers and javascript: links that CSP blocks: visible in edit mode, and in the browser console in read mode.
  • A script that fails to load (for example blocked by CSP) is logged to the console, and the remaining scripts still run.
  • Fixed the "empty" message not showing on a newly added web part, and the error message showing "undefined" when a content link failed to load.
  • The web part version is shown in edit mode and in the property pane.
  • jQuery is also available as $ (only if $ is not already defined).
  • Updated to SharePoint Framework v1.24.2 and the Heft build toolchain.
  • Removed the Norwegian translation. The web part is now English only.