在 Firefox 工具栏中保存下拉历史记录
为了学习,我正在 Firefox 工具栏上进行一些测试,但我找不到任何有关如何在用户个人资料中存储“搜索”下拉列表内容的信息。
有没有关于如何解决这个问题的教程?
I'm doing some testing on Firefox toolbars for the sake of learning and I can't find out any information on how to store the contents of a "search" drop-down inside the user's profile.
Is there any tutorial on how to sort this out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
由于需要相当长的时间才能得到答案,所以我自己去调查了。
这是我现在所拥有的。 我不是很清楚,但它有效。
假设您有一个像这样,在您的 .xul 上:
您现在必须添加一些其他属性来启用历史记录。
这为您提供了在该文本框中启用历史记录的最低限度。
由于某种原因,这就是我的无知所在,onTextEntered 事件函数必须有一个名为“param”的参数。 我尝试了“事件”,但没有成功。
但仅靠这一点是行不通的。 必须添加一些 JavaScript 来帮助完成这项工作。
这是让历史继续下去的绝对最低限度。
Since it's taking quite a bit to get an answer I went and investigate it myself.
Here is what I've got now. Not all is clear to me but it works.
Let's assume you have a <textbox> like this, on your .xul:
You now have to add some other attributes to enable history.
This gives you the minimum to enable a history on that textbox.
For some reason, and here is where my ignorance shows, the onTextEntered event function has to have the param to it called "param". I tried "event" and it didn't work.
But that alone will not do work by itself. One has to add some Javascript to help with the job.
This is the absolute minimum to get a history going on.
古斯塔沃,
我想做同样的事情 - 我找到了一个答案 此处位于 Mozilla 支持论坛。 (编辑:我出于兴趣而想保存我的搜索历史记录,而不是因为我想了解 Firefox 工具栏的工作原理,如您所说。)
基本上,该数据存储在名为 formhistory.sqlite 的 sqlite 数据库文件中(在您的 Firefox 中)配置文件目录)。 您可以使用 Firefox 扩展 SQLite Manager 检索和导出数据: https://addons.mozilla .org/firefox/addon/5817
您可以将其导出为 CSV(逗号分隔值)文件,并使用 Excel 或其他软件打开它。
这样做的另一个好处是,如果您对这些数据感兴趣的话,还可以保存您在网站上其他表单/字段(例如 Google 上的搜索字段等)中输入的数据的历史记录。
Gustavo,
I wanted to do the same thing - I found an answer here on the Mozilla support forums. (Edit: I wanted to save my search history out of interest, not because I wanted to learn how the Firefox toolbars work, as you said.)
Basically, that data is stored in a sqlite database file called formhistory.sqlite (in your Firefox profile directory). You can use the Firefox extension SQLite Manager to retrieve and export the data: https://addons.mozilla.org/firefox/addon/5817
You can export it as a CSV (comma- separated values) file and open it with Excel or other software.
This has the added benefit of also saving the history of data you've entered into other forms/fields on sites, such as the Search field on Google, etc, if this data is of interest to you.
Gustavo 的解决方案很好,但是 document.getElemenById('search_with_history').value; 在 getElementById 中缺少“t”
Gustavo's solution is good, but document.getElemenById('search_with_history').value; is missing a 't' in getElementById