• 2 Posts
  • 22 Comments
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle





















  • I tried the python code out and it actually does work for me, ie. I’m able to update an existing bookmark.

    # hashing code from link inserted here
    def update_place(id, new_url):
        new_url_hash = url_hash(new_url)
        conn = sqlite3.connect('places.sqlite')
        cur = conn.cursor()
        cur.execute('UPDATE moz_places SET url = ?, url_hash = ? WHERE id = ?', (new_url, new_url_hash, id))
        conn.commit()
        cur.close()
        conn.close()
    
    update_place(16299, "javascript:alert('Testing bookmarklet update ...');alert('Great success!');")
    

    Only annoying thing is that Firefox needs to be closed while updating. Anyway, I haven’t tried with bigger scripts though, so there might be some gotchas there.

    Agreed, keywords are really nice for keyboard navigation!