Open Bug 1806482 Opened 3 years ago Updated 29 days ago

Import/Export bookmarks to local fileystem

Categories

(Firefox for Android :: Bookmarks, enhancement, P3)

All
Android
enhancement

Tracking

()

People

(Reporter: kbrosnan, Unassigned)

References

(Depends on 2 open bugs, )

Details

From github: https://github.com/mozilla-mobile/fenix/issues/417.

Why/User Benefit/User Problem

  • If a user is using Fenix alone (without synced accounts), there is no backup of bookmarks if a user removes Fefix
  • Even if a user is using Sync, without a secondary machine "backing" up bookmarks, bookmarks will be lost if user removes Fenix
  • Users don't want to lose bookmarks

What / Requirements

As a user, I would like to be able to export bookmarks to my local filesystem and to later import them.

Acceptance Criteria (how do I know when I’m done?)

  • User can export bookmarks
  • User can import bookmarks, adding to existing bookmarks
  • Ideally, if identical bookmarks are present in the source and destination, bookmarks are merged

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

Severity: -- → S3
Priority: -- → P3

Enhancements should have severity N/A.

Severity: S3 → N/A

doesn't xBrowserSync work with firefox mobile?

Smarterbookmarks and Linkora (Linkora is open source) are android apps which allow you to import and export bookmarks.html

Depends on: 1970175
Depends on: 1970182

What dependency on 1970182???

Here is the code to implement, so you literally just have to place it inside Firefox repository, in the right file, an replace "names" =>

#!/usr/bin/bash

DB_PATH=$user/[FirefoxPath]/places.sqlite
FIREFOX_CMD=firefox
SQLITE_CMD=sqlite3
FILE=$user/bookmarks.html

# Get rows from database
rows=$($SQLITE_CMD "$DB_PATH" 'SELECT moz_bookmarks.title, moz_places.url FROM moz_bookmarks INNER JOIN moz_places WHERE moz_bookmarks.fk = moz_places.id;')

# Create bookmarks html file
cat > "$FILE" << EOF
<!DOCTYPE html>
<html>
  <head>
    <title>Bookmarks from places.sqlite</title>
  </head>
  <body>
    <h1>Bookmarks</h1>
    <table>
EOF

# Add bookmarks from database to file
oldIFS=$IFS
IFS=$'\n'
for row in $rows; do
	# Assuming delimeter is '|'...
	title=$(echo "$row" | awk -F '|' '{print $1}')
	url=$(echo "$row" | awk -F '|' '{print $NF}')

	printf "      <tr><td><a href='%s'>%s</a></td></tr>\n" "$url" "$title" >> "$FILE"
done
IFS=$oldIFS

# End html file correctly for completeness
cat >> "$FILE" << EOF
    </table>
  </body>
</html>
EOF

$FIREFOX_CMD "$FILE" >/dev/null 2>&1 &
Duplicate of this bug: 1941207
You need to log in before you can comment on or make changes to this bug.