我正在使用网络浏览器,并且在不更改任何 QWebEngineSettings 的情况下,github 无法加载必要的 javascript。
访问 github 时 QWebEngines javascript 输出
The Content-Security-Policy directive 'worker-src' is implemented behind a flag which is currently disabled.
Uncaught TypeError: this.toggleAttribute is not a function
Uncaught TypeError: this.toggleAttribute is not a function
Uncaught (in promise) ReferenceError: AbortController is not defined
...
等等,我试过设置
settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true);
settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, true);
并确保它们已启用,但没有任何成功。有谁碰巧知道我必须更改哪个安全策略才能使 github 工作?