从Chrome打包的应用保存文件 [英] Saving a file from a chrome packaged app

查看:104
本文介绍了从Chrome打包的应用保存文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Chrome打包的应用程序,虽然花了我一段时间才能引起注意,但我终于可以使用它了.但是我现在遇到了另一个问题.

I have a Chrome packaged app that has taken me a while to get my head around but I finally have it working. However I have now come across another problem.

是否可以将应用程序中的变量保存到放置在应用程序/文件目录中的文本文件中?

Is it possible to save a variable from my app into a text file that's placed in my app/file directory?

我看过chrome.fileSystem api,但我不太了解.

I have looked over the chrome.fileSystem api but I don't really understand it.

我可能完全错了,也许您无法将文件保存到文件目录中?

I could be completely wrong and maybe you can't save files to the file directory?

任何有关此的示例或教程都很棒!

Any examples or tutorials on this would be great!

谢谢!

推荐答案

我建议将文件的内容存储在chrome.storage中,然后从那里动态加载并保存CSS文件的内容,而不是使用文件系统.对我来说,这将更容易实现.

I would suggest storing the file's contents in chrome.storage and then dynamically loading and saving the contents of your css file from there instead of using the filesystem. To me, this would be much easier to accomplish.

这篇关于从Chrome打包的应用保存文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆