首页 > 解决方案 > Fiori Launchpad 错误“拒绝执行内联脚本...”

问题描述

我在“SAP HANA© XS Advanced Runtime on Premises”(docker image store/saplabs/hanaexpressxsa:2.00.036.00.20190223.1)的 WebIde 的“多目标应用程序”项目中创建了一个新的“SAP Fiori Launchpad 站点模块”,但在部署应用程序后出现此错误:

Refused to execute inline script because it violates the following Content Security Policy directive

重现问题的步骤:

  1. 在 WebIde 中新建一个“多目标应用程序项目”
  2. 向应用程序添加新的“SAP Fiori Launchpad 站点模块”
  3. 构建应用程序
  4. 在 SAP HanaXSA 实例上部署应用程序
  5. 尝试访问 Fiori Launchpad

您应该在浏览器控制台中看到错误

我尝试使用 Chrome(版本 75.0.3770.142)和 Firefox(68.0.1(64 位))访问该站点,但我得到了同样的错误。

我希望显示 Demo Fiori 站点,但显示的是一个空白页面,并且在浏览器控制台中显示以下错误:

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' https://hxehost:51036 https://sapui5.hana.ondemand.com". Either the 'unsafe-inline' keyword, a hash ('sha256-NgEjsBnwasEV3qUuFB3e//lUSMnxA7QXX71JM5aiVDU='), or a nonce ('nonce-...') is required to enable inline execution.

sites:11 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' https://hxehost:51036 https://sapui5.hana.ondemand.com". Either the 'unsafe-inline' keyword, a hash ('sha256-4HLEOQTTt5/QjdzyAx+0u3MGo5aetBm29vv3z8YAFuE='), or a nonce ('nonce-...') is required to enable inline execution.

sites:108 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' https://hxehost:51036 https://sapui5.hana.ondemand.com". Either the 'unsafe-inline' keyword, a hash ('sha256-weH3XITqj/IJEeUfXbDsdCe+LEtDyDiafcdwfH3Aumw='), or a nonce ('nonce-...') is required to enable inline execution.

标签: sapui5sap-fiorisap-web-idehana-xs

解决方案


推荐阅读