Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Option to export browser profile folder/settings to local storage #2080

Closed
sebast889 opened this issue Apr 26, 2019 · 4 comments
Closed

Option to export browser profile folder/settings to local storage #2080

sebast889 opened this issue Apr 26, 2019 · 4 comments
Labels
feature request 🌟 New functionality and improvements

Comments

@sebast889
Copy link

sebast889 commented Apr 26, 2019

Why/User Benefit/User Problem

There is no way to locally back up the Fenix profile and settings without having root access to the device and manually copying the folder/settings (which is still not an adequate backup).

It is tedious and time consuming to set up or customize the browser on a new install, new phone or in case of accidental data loss.

What / Requirements

Add an easy way for people to export profile folder/settings to a local storage or SD card such as in a single zip file

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

Add an easy way for people to export profile folder/settings locally so that the same backup is able to be imported back into Fenix as an EXACT copy of the backup (extensions, extension settings, preferences and settings, themes etc.) for example on a new phone.

┆Issue is synchronized with this Jira Task

@kbrosnan kbrosnan added the feature request 🌟 New functionality and improvements label Apr 26, 2019
@vesta0 vesta0 added the P2 Upcoming release label Apr 30, 2019
@vesta0 vesta0 added this to the Post-MVP Backlog milestone Apr 30, 2019
@vesta0 vesta0 removed P2 Upcoming release labels Jul 2, 2019
@vesta0 vesta0 modified the milestone: Feature Backlog Jul 26, 2019
@yoasif
Copy link
Contributor

yoasif commented Jun 9, 2020

Can we please prioritize this before Play Store cleanup occurs?

I personally ran into this because I got a replacement device due to a hardware issue - and I am still trying to figure out how to migrate my open tabs.

Even something as basic as what Signal offers would be handy: https://support.signal.org/hc/en-us/articles/360007059752-Backup-and-Restore-Messages#android_restore

@data-sync-user data-sync-user changed the title Option to export browser profile folder/settings to local storage FNX3-16044 ⁃ Option to export browser profile folder/settings to local storage Aug 11, 2020
@data-sync-user data-sync-user changed the title FNX3-16044 ⁃ Option to export browser profile folder/settings to local storage FNX-76 ⁃ Option to export browser profile folder/settings to local storage Aug 11, 2020
@kbrosnan kbrosnan changed the title FNX-76 ⁃ Option to export browser profile folder/settings to local storage Option to export browser profile folder/settings to local storage Aug 25, 2020
@Poopooracoocoo
Copy link

I'd really like to be able to export my bookmarks as an html file and to be able to import them. It'd also be really useful to be able to import/export passwords. I don't mind not being able to export history or site storage. If you could bookmark all tabs or import/export sessions, that'd let you import/export tabs.

Firefox for desktop gives you heaps of control over this. (the other issues surrounding this were just closed so I'm writing this comment as a way of keeping their content)

@harabat
Copy link

harabat commented Jan 9, 2023

While this is being actioned, I came up with a temporary workaround. This might be relevant to authors of #6002, #13451, #24922. This has been adapted from a post by @dveditz.

You will need to have the same Firefox version installed on your desktop and your Android phone and a USB cable.

  1. Connect your phone to your desktop with the USB cable, with data transfer

  2. On your phone, enable developer options, then enable remote debugging

  3. On your phone, launch Firefox Android/Fennec/Mull, then go to "Settings" and enable "Remote debugging via USB"

    debugging_remote
  4. On your phone, in Firefox Android/Fennec/Mull, open about:config

  5. On the desktop, go to about:debugging

  6. In the left sidebar, connect to the Firefox Android, then click on it

    debugging_connect
  7. On your phone, in the mobile browser, scroll all the way to the bottom of the about:config tab

    • This will take a little while, but is necessary in order to load all the settings
  8. In the Tabs dropdown, in about:config, click on "Inspect"

    debugging_inspect
    • This will open a new "Toolbox (USB)" tab in the desktop browser
  9. On the desktop, in the left sidebar, right-click on the very first element and select "Edit as HTML"

    debugging_edit
  10. When the HTML elements turn into plain text, select all (right-click and "Select all" or just press "Ctrl-A") and copy

    debugging_select_all
  11. Paste the copied text into an editor and save as about_config.html

    • This file is structured in the following way:
      • Relevant information is in first li tag and the input tag
      • Each setting is a li item in the <ul id="prefs-container"> element
      • When a setting has default="false", the "Reset" button is enabled
      • Settings of type="text" have "Toggle" and up/down buttons disabled
      • Booleans (type="button") can be toggled
      • Numbers can be increased and decreased
  12. Run the following Python script on the newly created file:

    import json
    import pathlib
    
    from bs4 import BeautifulSoup
    
    # read the file
    root = pathlib.Path.cwd()
    file = root / "about_config.html"
    html_doc = file.read_text().replace("\n", "")
    
    # parse html
    html = BeautifulSoup(html_doc, "html.parser")
    
    # locate prefs
    prefs_container = html.find(id="prefs-container")
    
    # collect settings
    settings = {}
    
    for i in prefs_container.children:
        settings[i.attrs["name"]] = {
            k: v for k, v in i.attrs.items() if k in ["value", "default"]
        }
        settings[i.attrs["name"]]["type"] = i.find("input").attrs["type"]
    
    # save non-default settings js file (same format as prefs.js and user.js)
    file_js = root / "about_config.js"
    
    user_prefs_js = ""
    
    for k, v in settings.items():
        # skip non-default
        if v["default"] == "true":
            continue
        value = v["value"] if v["type"] != "text" else f'"{v["value"]}"'
        user_pref = f'user_pref("{k}", {value});\n'
        user_prefs_js += user_pref
    
    file_js.write_text(user_prefs_js)
    
    # save all settings as json file
    file_json = root / "about_config.json"
    
    with file_json.open("w") as target_json:
        json.dump(settings, target_json, indent=4)
  13. You should now have 2 files:

    • about_config.jscontaining your modified preferences (same as what Firefox on desktop stores in prefs.js)

      user_pref("accessibility.force_disabled", 1);
      user_pref("security.OCSP.require", true);
      // other settings...
    • a JSON file with all your settings

      {
          "accessibility.force_disabled": {
              "default": "false",
              "value": "1",
              "type": "number"
          },
          "security.OCSP.require": {
              "default": "false",
              "value": "true",
              "type": "button"
          }
          // other settings...
      }

@csadilek
Copy link
Contributor

Moved to bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1809963

Change performed by the Move to Bugzilla add-on.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request 🌟 New functionality and improvements
Projects
None yet
Development

No branches or pull requests

7 participants