JavaFX Webview内容安全策略

时间:2018-11-03 00:10:17

标签: java javafx content-security-policy

我目前正在开发一个桌面应用程序,该应用程序要求用户通过JavaFX Webview窗口登录Gmail。从我的IDE运行时,一切都会正常进行。但是,在编译时,各种必需的资源拒绝在WebConsoleListener中加载,并出现以下错误。

Refused to load the script 'https://accounts.google.com/accounts/static/_/js/k=gaia.gaiafe_glif.en_GB.PVJjazBgGx4.O/am=AgXAAAAABPB9AQAMEIIi6BCcI4D_a_7_hRMBgAAYxCHD_QfsQM8uBQ/rt=j/d=0/rs=ABkqax2l76m1zVKIHh4nltVYUPcQUfSKLw/m=P9M9H,sy8u,sy8y,sy9m,sy9a,sy9k,em3m,em3n,em3o,sy9e,m5Z1Eb,sy8v,sy8w,sy8t,sy8x,sy8z,sy90,sy92,sy9f,sy3k,sy7t,em3z,em3y,em3x,em3l,em40,em3p,em3q,em3r,em3s,em3t,em3u,em3v,em3w,YmeC5c' because it violates the following Content Security Policy directive: "script-src 'report-sample' 'nonce-Etr6m2y6XLpGAmzNQCYWz2iwGhM' 'unsafe-inline' 'unsafe-eval'".

Refused to load the script 'https://accounts.google.com/accounts/static/_/js/k=gaia.gaiafe_glif.en_GB.PVJjazBgGx4.O/am=AgXAAAAABPB9AQAMEIIi6BCcI4D_a_7_hRMBgAAYxCHD_QfsQM8uBQ/rt=j/d=0/rs=ABkqax2l76m1zVKIHh4nltVYUPcQUfSKLw/m=P9M9H,sy8u,sy8y,sy9m,sy9a,sy9k,em3m,em3n,em3o,sy9e,m5Z1Eb,sy8v,sy8w,sy8t,sy8x,sy8z,sy90,sy92,sy9f,sy3k,sy7t,em3z,em3y,em3x,em3l,em40,em3p,em3q,em3r,em3s,em3t,em3u,em3v,em3w,YmeC5c' because it violates the following Content Security Policy directive: "script-src 'report-sample' 'nonce-Etr6m2y6XLpGAmzNQCYWz2iwGhM' 'unsafe-inline' 'unsafe-eval'".

我不完全了解内容安全策略在Java中的确切工作方式或声明的位置,但我想知道是否应该设置任何系统属性以允许加载此类脚本?任何帮助将不胜感激。

0 个答案:

没有答案