Using customUI to show HTML & run javascript with forge UI

Hi all,
Today I learn a new way to develop a macro for confluence cloud by using forge UI. The following page Custom UI gives me a good example how to show the context in customized HTML. I copy and paste the code, deploy and install it, it works well.

In the same page, it states that “Using custom UI, you can define your own user interface using static resources, such as HTML, CSS, JavaScript, and images.” I think it does support javascript too. I am trying to use the following HTML that calls a third-party javascript to render some math formula

<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>MathJax example</title>
  <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
  <script id="MathJax-script" async
          src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js">
  </script>
</head>
<body>
  When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
  \[x = {-b \pm \sqrt{b^2-4ac} \over 2a}.\]
</body>
</html>

I try to save this page to a local HTML and run it in a browser, it works. But when I run the macro with index.html replaced with the above HTML, everything will be shown literally. I wonder if the customUI supports the external javascript or not

I think you will find the way to do it here: https://developer.atlassian.com/platform/forge/manifest-reference/permissions/#external-permissions