从XPCOM组件访问Firefox缓存 [英] Accessing Firefox cache from an XPCOM component

查看:271
本文介绍了从XPCOM组件访问Firefox缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何根据来自XPCOM组件的URL获取Firefox缓存的文件的本地路径?

Does anybody know how to get local path of file cached by Firefox based on its URL from an XPCOM component?

推荐答案

要访问缓存的项目,必须使用 createSession 方法创建新的缓存会话rel =nofollow> nsICacheService 。此方法创建 nsICacheSession
目的。有关缓存项目的信息可以使用会话对象的 openCacheEntry 方法获取(方法返回 nsICacheEntryDescriptor )。要读取数据,用户必须使用缓存条目对象的 openInputStream 方法打开输入流。

To access cached items, new cache session must be created using createSession method provided in nsICacheService. This method creates nsICacheSession object. Information about cache item can be obtained using openCacheEntry method of the session object (method return nsICacheEntryDescriptor). To read data user must open input stream using openInputStream method of the cache entry object.

这篇关于从XPCOM组件访问Firefox缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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