在Firefox插件中访问历史记录 [英] accessing history in a firefox addon

查看:181
本文介绍了在Firefox插件中访问历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用插件生成器来制作Firefox插件。我想定期扫描浏览器的历史..整个历史。我正在寻找诸如 Chrome浏览器历史记录的功能。看来 window.history 是仅限于会话历史记录。任何帮助?我疯了试图弄清楚这一点。 历史导出等插件必须做类似这个,但是他们的代码对我来说是不能马上理解的。

你需要访问xpcom服务 nsIBrowserHistory ,下面是一些与SDK协同工作的示例代码:



https://builder.addons.mozilla.org/ package / 157396 / latest /

api的位置有点冗长,MDN上提供了大量示例:

https://developer.mozilla.org/zh-CN/docs / Querying_Places



还有一个由Mozilla社区成员开发的模块vailable这里提供了一些抽象:

https://github.com/autonome/Jetpack-Modules/blob/master/places.js



我不确定如果上面的模块已经过最新版本的Firefox和SDK的测试。


I'm working on a firefox addon, using the addon builder. I want to periodically scan the browser's history.. the entire history. I'm looking for functionality like chrome's history api. It seems window.history is limited to session history only. Any help? I'm going crazy trying to figure this out. Addons like history export must do something like this, but their code is not immediately understandable to me.

解决方案

You'll need to access the xpcom service nsIBrowserHistory, here's some example code that works with the SDK:

https://builder.addons.mozilla.org/package/157396/latest/

The places api is a bit verbose, there are extensive examples available on MDN:

https://developer.mozilla.org/en-US/docs/Querying_Places

There is also a module developed by Mozilla community members available here that provides some abstractions:

https://github.com/autonome/Jetpack-Modules/blob/master/places.js

I'm not sure if theabove module has been tested against recent versions of Firefox and the SDK.

这篇关于在Firefox插件中访问历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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