Chrome Local Storage
This Python package makes it easy to interact with Google Chrome local storage,
either a locally-running browser or any remote browser that supports remote
debugging (e.g. Chrome on Android via adb port forwarding).
Prerequisites
Installation is via pip:
pip install chrome-local-storage
Chrome must be running with the debugging port active for the library to connect. There are various methods to do this, for example, on Windows:
chrome.exe --remote-debugging-port=9222
And on MacOS:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
The library will also work on any mobile device that supports remote debugging on Chrome, For example, on Android, use the Android Debug Bridge to set up a port forward as follows:
adb forward tcp:9222 localabstract:chrome_devtools_remote
In all of the above examples, the debugger will be available at localhost:9222
which is what the library expects by default.
Usage
Basic usage is as follows:
import chrome_local_storage
local_storage = chrome_local_storage.ChromeLocalStorage()
local_storage.set('example.com', 'my-key', 'my-value')
value = local_storage.get('example.com', 'my-key')
print(value)
The first parameter in both get and set determines the page
whose local storage will be used for the operation. The page must
already be open in the browser, and it does not have to be an exact
match to the whole URL as long as it's unique across open pages.
In a more complex example, two constructors connect to two different Chrome instances and copy Wordle statistics from one to the other (the desire to transfer my streak from one device to another was the original motivation for building this library).
chrome --remote-debugging-port=9222 "https://nytimes.com/games/wordle"
adb forward tcp:9223 localabstract:chrome_devtools_remote
import chrome_local_storage
laptop_storage = chrome_local_storage.ChromeLocalStorage(port=9222)
phone_storage = chrome_local_storage.ChromeLocalStorage(port=9223)
wordle_stats = laptop_storage.get('games/wordle', 'nyt-wordle-statistics')
phone_storage.set('games/wordle', 'nyt-wordle-statistics', wordle_stats)
Metadata
Release files for chrome-local-storage 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| chrome-local-storage-0.6.0.tar.gz | 4.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chrome_local_storage-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.6 kB
Release files / chrome-local-storage-0.6.0.tar.gz
| Download URL | chrome-local-storage-0.6.0.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa79503bae70703c70131fc02bb1032182f143a3da7b0babc5b630ee25237f74
|
|
BLAKE2b-256 checksum How to use checksums |
22955abe278d5f6b12e46f77eba1122f2b08b4c0fb0256476147594283c4c81f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.12 Linux/5.13.0-1022-azure
|
Release files / chrome_local_storage-0.6.0-py3-none-any.whl
| Download URL | chrome_local_storage-0.6.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da6a7453812ce887d871ea54adb07263515af3acd725ca4fc85eff2153b0e0c7
|
|
BLAKE2b-256 checksum How to use checksums |
9680b2d7519d508a7f0c11ae05a5cb0b1bcf5fefe12cc705b145951ecc80747a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.12 Linux/5.13.0-1022-azure
|
Security for chrome-local-storage 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.