Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arshadkazmi42/firefox-cookie
Firefox cookie manager for node. To set and get cookie from firefox
https://github.com/arshadkazmi42/firefox-cookie
cookie cookie-crud cookie-manager crud database firefox firefox-cookie-manager sqlite
Last synced: 3 months ago
JSON representation
Firefox cookie manager for node. To set and get cookie from firefox
- Host: GitHub
- URL: https://github.com/arshadkazmi42/firefox-cookie
- Owner: arshadkazmi42
- License: mit
- Created: 2019-08-25T13:07:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-15T08:54:15.000Z (over 3 years ago)
- Last Synced: 2024-10-07T06:41:27.359Z (4 months ago)
- Topics: cookie, cookie-crud, cookie-manager, crud, database, firefox, firefox-cookie-manager, sqlite
- Language: JavaScript
- Size: 268 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# firefox-cookie
[![Build](https://github.com/arshadkazmi42/firefox-cookie/actions/workflows/nodejs.yml/badge.svg)](https://github.com/arshadkazmi42/firefox-cookie/actions/workflows/nodejs.yml)
Node Cookie Manager for Firefox, read / write cookie from sqlite db
## Install
```
npm i firefox-cookie
```## Usage
```javascript
// Search for the "default" profile in Firefox implicitly https://support.mozilla.org/gl/questions/1264072
const FirefoxCookie = require('firefox-cookie');
const FFCookie = new FirefoxCookie();// Search for the "default-release" new profile in Firefox explicitly (or any other profile you give as parameter)
const FirefoxCookie = require('firefox-cookie');
const FFCookie = new FirefoxCookie("default-release");// Reading cookie
const cookie = await FFCookie.getCookie('arshad.com');// Inserting cookie
const DATA = [
{
'baseDomain': 'arshad.com',
'originAttributes': '',
'name': 'arshad',
'value': 'arshad-test-cookie',
'host': 'arshad.com',
'path': '/root',
'expiry': 1,
'lastAccessed': 111111111,
'creationTime': 10001110,
'isSecure': 1,
'isHttpOnly': 0,
'inBrowserElement': 0,
'sameSite': 0,
}
];await FFCookie.setCookie(DATA);
```## API
- **`getCookie(path)`**
- Returns cookie json from database for the input path
- **Params**
- path (String)- **`setCookie(cookies)`**
- Adds all the input cookies into the sqlite database
- **Params**
- cookies (Array of cookies object)- **`removeCookie(domain)`**
- Removes all records matching the domain.
- > It uses `like` condition (`%domain%`) so anything matching the pattern will be removed
- **Params**
- path (String)## Contributing
Interested in contributing to this project?
You can log any issues or suggestion related to this library [here](https://github.com/arshadkazmi42/firefox-cookie/issues/new)Read our contributing [guide](CONTRIBUTING.md) on getting started with contributing to the codebase
## Contributors
Thank you to all the contributors who have helped us in making this project better :raised_hands: