Git Product home page Git Product logo

electron-cookies's Introduction

Important! This repository has moved.

For the currenlty maintained version, see heap/electron-cookies.

Electron Cookies

(Formerly called atom-shell-cookies)

Adds support for cookies in Electron. Cookies are persisted through localStorage.

Forked from https://gist.github.com/paulcbetts/2d2de55d137a1cf9d1ac.

Why?

Electron's renderer environment doesn't come with built in support for a document.cookie API. Thus, if you want to use Google Analytics or another client-side analytics library, they won't work because they can't set cookies.

By using this package, you can drop client-side analytics code into your app and it will work splendidly.

Installation

npm install electron-cookies

Usage

In your app's renderer code, just require this package:

require('electron-cookies')

Contributing

Original code is written in src/index.coffee, with tests at spec/electron_cookies_spec.coffee. Write code in coffeescript, and run grunt to compile coffeescript on the fly.

electron-cookies's People

Contributors

hstove avatar jlthai avatar yoshuawuyts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

electron-cookies's Issues

Cookies read from storage every request

Have you given any thought to optimizing this a bit by ensuring the entire cookie storage (locaStorage.cookies) isn't read and parsed on every cookie request?

While the current implementation works fine for small-medium storages, it can get costly when working with larger sets. I thought about having a crack at a PR but wasn't sure if it was on your radar or what your thoughts were.

Thanks!

Cookie expiration

Have you given any thought to cookie expiration?

key=value; Expires=Thu, 01-Jan-1970 00:00:01 GMT

cookies are not being sent in xhr request

Hey,
I'm not sure which project this issue belongs, but I'm not seeing the document.cookie value being sent along with the XHR request header.

I'm using Angular within the Electron shell so I'm using the withCredentials = true approach, similar to using withCredentials: true via $.ajax request.

when I include the electron-cookies package, an alert(document.cookie) gives me the proper cookies that need to be included in the XHR request.

Hopefully that's not too vague. Any ideas? thanks!

Missing license

Need a file license in order to use this with my project! Preferably MIT =)
I see it just says MIT in package.json, but I need a full file

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.