Giter Club home page Giter Club logo

chrome-cookie's Introduction

chrome-cookie

Build NPM Version NPM Downloads Github Repo Size LICENSE Contributors Commit

Node Cookie Manager for Chrome, read / write cookie from sqlite db

Install

npm i chrome-cookie

Usage

const ChromeCookie = require('chrome-cookie');
const CCookie = new ChromeCookie();

// Reading cookie
const cookie = await CCookie.getCookie('arshad.com');

// Inserting cookie
const DATA = [
  {
    'creation_utc': 'now',
    'encrypted_value': 'enc2',
    'expires_utc': 'never',
    'has_expires': 'yes',
    'host_key': 'arshad.com',
    'is_httponly': 'yes',
    'is_persistent': 'no',
    'is_secure': 'yes',
    'last_access_utc': 'now',
    'name': 'arshad',
    'path': '/root',
    'priority': 'no',
    'value': 'kazmi',
    'samesite': -1
  }
];

await CCookie.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

Read our contributing guide on getting started with contributing to the codebase

chrome-cookie's People

Contributors

arshadkazmi42 avatar cesar-codes avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

chrome-cookie's Issues

Support to undefined values

if a key is missing from the request data, add handler to support that or give proper messaging.
Example:

const ChromeCookie = require('chrome-cookie');
const CCookie = new ChromeCookie();



const DATA = [
      {
        'creation_utc': 'now',
        'encrypted_value': 'enc2',
        'expires_utc': 'never',
        'has_expires': 'yes',
        'host_key': 'youtube.com',
        'is_httponly': 'yes',
        'is_persistent': 'no',
        'is_secure': 'yes',
        'last_access_utc': 'now',
        'name': 'youtube',
        'path': '/root',
        'priority': 'no',
        'value': 'kazmi',
        'samesite': -1,
        'encrypted_value': {}
      }
    ];

CCookie.setCookie(DATA);

above code breaks if we remove encrypted_value

Add badges for readme using npm-badger

  1. Install npm badger npm install npm-badger -g
  2. Clone this repository git clone https://github.com/arshadkazmi42/chrome-cookie
  3. Go to root directory cd chrome-cookie
  4. Run npm badger npm-badger
  5. Commit README.md file
  6. Create Pull Request

Update the model `cookie.json`

Seems chrome has introduced some more columns in its cookies table.

Revisit the and update the model

One column we know about its top_frame_site_key

fix vulnerability

  • Delete package-lock.json
  • Run npm install
  • Commit package-lock.json
  • Create pull request

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.