@livesession/electron-cookies
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Electron Cookies

Electron's environment doesn't come with built in support for a document.cookie API. By using this package, you can use the same Document cookie API within Electron.

Installation

First, install the package:

npm install @livesession/electron-cookies

Usage

import ElectronCookies from '@livesession/electron-cookies';

// enable
ElectronCookies.enable({
  origin: 'https://example.com',
}); // or ElectronCookies.enable() for default

// disable
ElectronCookies.disable();

If your Electron app has the nodeIntegration preference set to false, you can include the dist via a <script> tag:

 <script src='./node_modules/@livesession/electron-cookies/dist/main.js'></script>

And inside JavaScript:

window.ElectronCookies.enable();

Readme

Keywords

none

Package Sidebar

Install

npm i @livesession/electron-cookies

Weekly Downloads

110

Version

1.0.1

License

none

Unpacked Size

1.02 MB

Total Files

10

Last publish

Collaborators

  • kdrazkiewicz
  • zielinskipawel
  • pzdunowski.livesession
  • zdunecki