Results 1 to 10 of 18

Thread: How to access Firefox 3 bookmarks from the command line?

Hybrid View

  1. #1
    Join Date
    Oct 2006
    Beans
    584
    Distro
    Ubuntu

    Question How to access Firefox 3 bookmarks from the command line?

    On the firefox forums someone told me to use sqlite but it doesn't work.

    It tells me that the database is locked:
    Error: database is locked
    If I close firefox it tells me:
    Unable to open database ".mozilla/firefox/adnu2zvf.default/places.sqlite": file is encrypted or is not a database

    Here it is the post on mozillazine:
    http://forums.mozillazine.org/viewtopic.php?t=655853
    Last edited by Yuzem; May 19th, 2008 at 04:10 AM.

  2. #2
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to access Firefox 3 bookmarks from the command line?

    In answer to your thread title question:
    Code:
    nano -B ~/.mozilla/firefox/adnu2zvf.default/bookmarks.html
    should do it.

    What might solve the post problem is:
    Code:
    mv ~/.mozilla ~/.mozilla.old
    firefox &

  3. #3
    Join Date
    Oct 2006
    Beans
    584
    Distro
    Ubuntu

    Re: How to access Firefox 3 bookmarks from the command line?

    Quote Originally Posted by aysiu View Post
    In answer to your thread title question:
    Code:
    nano -B ~/.mozilla/firefox/adnu2zvf.default/bookmarks.html
    should do it.
    That is the old bookmark file. I need to access the new bookmarks: places.sqlite (firefox 3)

    Quote Originally Posted by aysiu View Post
    What might solve the post problem is:
    Code:
    mv ~/.mozilla ~/.mozilla.old
    firefox &
    If I do that I will lose all my bookmarks, extensions and settings and what would be the effect?

  4. #4
    Join Date
    Oct 2006
    Beans
    584
    Distro
    Ubuntu

    Re: How to access Firefox 3 bookmarks from the command line?

    aysiu: Could you move this thread to the Programming Talk sub forum or I should ask again there?

    What I really want to know is how to access firefox3 bookmarks form bash to add support for them to avatar-factory.

    I realize that the Programming Talk sub forum is a better place for this question.

    Thanks.

  5. #5
    Join Date
    Aug 2007
    Location
    127.0.0.1
    Beans
    1,800
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to access Firefox 3 bookmarks from the command line?

    Having the command line interface of sqlite3 (sqlite3 package on synaptic)

    Code:
    sqlite3 places.sqlite
    Code:
    sqlite> .databases
    seq  name             file                                                      
    ----------------------------------------------------------
    0    main             /home/canxp/places.sqlite
    Code:
    sqlite> .tables
    moz_anno_attributes  moz_favicons         moz_keywords       
    moz_annos            moz_historyvisits    moz_places         
    moz_bookmarks        moz_inputhistory   
    moz_bookmarks_roots  moz_items_annos
    sqlite> SELECT * FROM moz_bookmarks
    That last one produces a huge output.

    Use the sqlite3 module of python, or the one on C, if you need to do something else with this data.

    I made a copy of the file on my home folder by the way. Most probably, the error you get is that you're trying to open the database while firefox has a lock on it.

    *edit*
    Also, there's a little trick with firefox, you can make another account for your testing, open firefox with:

    Code:
    firefox-3.0 -ProfileManager
    That will let you create new profiles (that are stored in the .mozilla folder), with that you can test without screwing with important data.
    Last edited by Can+~; May 20th, 2008 at 05:28 PM.
    "Just in terms of allocation of time resources, religion is not very efficient. There's a lot more I could be doing on a Sunday morning."
    -Bill Gates

  6. #6
    Join Date
    Oct 2006
    Beans
    584
    Distro
    Ubuntu

    Re: How to access Firefox 3 bookmarks from the command line?

    Thanks, that worked but I still can't access the database if firefox is running:
    Code:
    Error: database is locked
    If a copy places.sqlite to temp dir I still get an error:
    Code:
    Unable to open database "places.sqlite": file is encrypted or is not a database
    I don't need to do any advanced thing. I just need to parse all the bookmarks to manipulate them with bash.

    Is there a simple command to export the bookmarks to a text format that can be accessed with cat, grep, sed etc...?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •