阅读:1572回复:5
firefox浏览器的组件问题
请教个问题。我想使用js写一个函数实现清空firefox缓存的目的。 但是我不太熟悉这个fiefox的组件使用问题。我仿照着firefox上面的一个扩展里面的js写了一个函数,但是不可以用。请大神看看是思路哪里有问题 谢谢
这是我引用的扩展代码处: https://addons.mozilla.org/zh-CN/firefox/files/browse/274404/file/chrome/content/button.js https://addons.mozilla.org/zh-CN/firefox/addon/empty-cache-button/?src=search 这是我改写js函数: function clearCache() { Components.classes["@mozilla.org/netwerk/cache-storage-service;1"].getService(Components.interfaces.nsICacheStorageService).clear(); Components.classes["@mozilla.org/netwerk/cache-storage-service;1"].getService(Components.interfaces.nsICacheStorageService).purgeFromMemory(3); } 请指点一下 |
|
1楼#
发布于:2015-03-04 12:00
楼主你调用这个函数了吗,空摆着可没用。 clearCache(); 我试了有效。
|
|
2楼#
发布于:2015-03-04 19:58
|
|
3楼#
发布于:2015-03-04 21:31
|
|
4楼#
发布于:2015-03-08 12:38
|
|
5楼#
发布于:2015-03-08 21:45
|
|