Socket
Book a DemoInstallSign in
Socket

@livesession/electron-cookies

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@livesession/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.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
232
22.75%
Maintainers
5
Weekly downloads
 
Created
Source

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();

FAQs

Package last updated on 12 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts