Skip to main content

Utility to access Firefox profile data.

Project description

Firefox profile

Copyright 2020 Luís Gomes luismsgomes@gmail.com, all rights reserved.

Installation

pip3 install firefox-profile

Usage from Python

from firefox_profile import FirefoxProfile

for profile in FirefoxProfile.get_profiles():
    recovery_data = profile.get_recovery_data()
    if recovery_data is None:
        continue
    for i, window in enumerate(recovery_data.windows):
        # do something with window:
        print(f"window {i}")
        print(f"  workspace: {window.workspace}")
        print(f"  zindex: {window.zindex}")
        print(f"  size: {window.size!r}")
        print(f"  position: {window.position!r}")
        print(f"  mode: {window.mode}")
        print(f"  tabs:")
        for j, tab in enumerate(window.tabs):
            # do something with tab:
            print(f"    tab {j}")
            print(f"      url: {tab.url}")
            print(f"      title: {tab.title}")
            print(f"      last_accessed: {tab.last_accessed}")

Usage from command line

firefox-profile-json

Will output something like:

[
    {
        "profile": "default",
        "windows": [
            {
                "tabs": [
                    {
                        "last_accessed": "2020-12-07T17:16:19.703000",
                        "url": "https://docs.python.org/3/library/os.html#os.open",
                        "title": "os \u2014 Miscellaneous operating system interfaces \u2014 Python 3.9.1rc1 documentation"
                    }
                ]
            }
        ],
        "workspace": "2",
        "zindex": 3,
        "size": [
            1716,
            1373
        ],
        "position": [
            0,
            37
        ],
        "mode": "minimized"
    }
]

License

This software is licensed under the MIT license.

https://opensource.org/licenses/MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

firefox-profile-0.0.3.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file firefox-profile-0.0.3.tar.gz.

File metadata

  • Download URL: firefox-profile-0.0.3.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for firefox-profile-0.0.3.tar.gz
Algorithm Hash digest
SHA256 82684a2f7629495d9097f42b5a9aa714d28f48432b23f44d534c3a58d89f565d
MD5 3522e7f96ddfbdfc6f27e0118d4c1d90
BLAKE2b-256 d7f1847c8d8ee1c08440c825d4bc87631420bb154bb410c166d28903a749b8a4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page