英文:
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 = {});
};
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论