File access system api(wicg-file-system-access) is not loading in dev environment.

huangapple go评论79阅读模式
英文:

File access system api(wicg-file-system-access) is not loading in dev environment

问题

我正在使用wicg-file-system-access来访问本地文件,用于我的Angular应用程序。它在本地主机上运行正常,但当我部署更改到开发环境时,它不起作用,我看到window.showSaveFilePicker未定义。

是否需要对部署的站点进行任何配置?

英文:

I am using wicg-file-system-access to access local files for my angular application, it works correctly on localhost but when i deploy changes to dev environment it is not working, i see window.showSaveFilePicker is undefined.

Is there any configuration that required for deployed site?.

答案1

得分: 0

是的,您需要一个SecureContext(https:// 或 localhost)。

英文:

Yes, you need a [SecureContext] (https:// or localhost).

[SecureContext] // <-- This means it's only exposed in secure contexts
partial interface Window {
    Promise<sequence<FileSystemFileHandle>> showOpenFilePicker(optional OpenFilePickerOptions options = {});
    Promise<FileSystemFileHandle> showSaveFilePicker(optional SaveFilePickerOptions options = {});
    Promise<FileSystemDirectoryHandle> showDirectoryPicker(optional DirectoryPickerOptions options = {});
};

huangapple
  • 本文由 发表于 2023年3月8日 19:14:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/75672294.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定