I assume this is not your real use case, but overall it depends on the particular script, whether it will work in a local or web context. See Features and Contextual Limitations for an overview. If you can pull the script into a local JS file instead of calling it from the head, I would recommend this instead of messing with application security contexts.
Your console.log example works if it starts from a package (as you noticed), or if it works in a web context. You can force the entire application to start in a web context by changing the start page to ms-appx-web: ///default.html in the manifest.
However, since the application is now in a limited web context, it will not have access to all Windows Runtime. You can open this by adding the following to the "Application" section of the manifest:
<uap:ApplicationContentUriRules> <uap:Rule Type="include" Match ="ms-appx-web:///" WindowsRuntimeAccess="allowForWebOnly"/> </uap:ApplicationContentUriRules>
You will need to open the manifest in the code editor, and not in the manifest editor, to change this section.
For more information about the error, see Edge Console Errors and Status Codes documentation.
source share