我在使用 Firefox 中的标准导出功能将 Firefox 中的数千个书签导出到 HTML 文件时遇到问题。我收到此错误:
*************************
A coding exception was thrown and uncaught in a Task.
Full message: TypeError: root is undefined
Full stack: BookmarkExporter@resource://gre/modules/BookmarkHTMLUtils.jsm:980:1
BHU_exportToFile/<@resource://gre/modules/BookmarkHTMLUtils.jsm:228:22
TaskImpl_run@resource://gre/modules/Task.jsm:314:40
Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:865:23
this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:744:7
*************************
参见https://gist.github.com/rubo77/12ef9be4060c7935c74c
有没有办法在控制台上导出我的书签,以便我可以将它们导入到新的 Firefox 配置文件中?
更新:我设法将旧配置文件的 Firefox 实例的“管理书签”菜单中的所有书签复制并粘贴到同时打开新配置文件的另一个实例中(使用命令行选项
-no-remote
)。但不幸的是,这仍然没有复制用于我的书签的标签,这也将是一个巨大的损失。
书签保存在您的个人资料目录下 [1](例如,在 Linux 下类似于
~/.mozilla/firefox/rbbfa46q.default
的位置,或者在 snap 版本中,在 ~/snap/firefox/common/.mozilla/firefox/rbbfa46q.default
中)存储在文件 places.sqlite
(一个 SQLite)中3.x 数据库。您可以将其作为每个 SQLite 数据库文件进行管理。
由于按键可能会发生冲突,至少在原则上,我建议导出为 HTML 链接列表,然后在第二个 Firefox 帐户中导入。
以下是实际上能够创建此列表的命令,如另一个答案中报告的那样[2]。
sqlite3 places.sqlite "select '<a href=''' || url || '''>' || moz_bookmarks.title || '</a><br/>' as ahref from moz_bookmarks left join moz_places on fk=moz_places.id where url<>'' and moz_bookmarks.title<>''" > t1.html
然后你就可以使用你觉得更舒服的导入方法了。
注意: