电子定制方案-各种特权是什么意思?



参考这些文档:https://www.electronjs.org/docs/latest/api/structures/custom-scheme

这些特权实际上是做什么的?特别是standardsecure,stream的不确定性:

  • privileges对象(可选)
    • standardboolean(可选)-默认为false。
    • secureboolean(可选)-默认为false。
    • bypassCSPboolean(可选)-默认为false。
    • allowServiceWorkersboolean(可选)-默认为false。
    • supportFetchAPIboolean(可选)-默认为false。
    • corsEnabledboolean(可选)-默认为false。
    • streamboolean(可选)-默认为false。

选项standard,secure,bypassCSPcorsEnabled对应于本文件中描述的铬方法。

因此,secure选项意味着该方案不会触发混合内容警告。

选项allowServiceWorkerssupportFetchAPI分别用于在chromium引擎中将此方案注册为支持service worker和fetch API。

选项stream指定此方案将用于音频或视频流。

最新更新