Modern CEWP 1.0.0.7 released

Home › Forums › Modern CEWP › Modern CEWP 1.0.0.7 released

Tagged: 

Viewing 0 reply threads
  • Author
    Posts
    • #39983
      Alexander Bautz
      Keymaster

        Modern CEWP 1.0.0.7 released

        A new version of the Modern CEWP is now available. It fixes a few issues with how scripts and styles are loaded, and adds warnings for code that SharePoint’s Content Security Policy (CSP) blocks.

        Download: https://github.com/SPJS/ModernCEWP/releases/tag/v1.0.0.7

        Upload modern-cewp.sppkg to your App Catalog to replace the previous version. From this version on, you can see which version you’re running in the web part when the page is in edit mode.

        Fixes

        • Functions and variables declared in one script can be used from other scripts again, like in the classic CEWP.
        • External stylesheets (<link rel="stylesheet">) in linked HTML files are now loaded, and relative paths to scripts and stylesheets are resolved against the HTML file.
        • Template and JSON <script> blocks are no longer run as JavaScript. They are kept in the page so your code can read them.
        • If one script fails to load, the rest still run, and the error is shown in the browser console.
        • A newly added web part now shows the “You must supply either HTML code or a link to a HTML file” message, and a content link that fails to load shows the actual error message.

        New

        • CSP warning: in edit mode, the web part warns you if your content uses inline event handlers like <button onclick="doSomething()"> or javascript: links. SharePoint blocks these, so attach the handler from a script instead:
          document.getElementById("myButton").addEventListener("click", doSomething);
        • The web part version is shown in edit mode and at the top of the property pane.
        • jQuery is now also available as $ (only if $ is not already defined).
        • Updated to the latest SharePoint Framework (1.24.2).

        Let me know here in the forum if you run into any problems.

        Alexander

    Viewing 0 reply threads
    • You must be logged in to reply to this topic.