Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

enable-window-document

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enable-window-document - npm Package Compare versions

Comparing version 1.17.0 to 1.19.0

4

index.js

@@ -5,3 +5,5 @@ let JSDOM = require('jsdom'),

resources: 'usable',
runScripts: 'dangerously'
runScripts: global.UNSAFE_MODE
? 'dangerously'
: 'outside-only'
});

@@ -8,0 +10,0 @@

{
"name": "enable-window-document",
"version": "1.17.0",
"version": "1.19.0",
"description": "Enables \"window\" and \"document\" globals so browser code does not throw errors in Node. Built with JSDOM.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -42,3 +42,5 @@ # Enable `window` and `document`

resources: 'usable',
runScripts: 'dangerously'
runScripts: global.UNSAFE_MODE
? 'dangerously'
: 'outside-only'
});

@@ -50,2 +52,5 @@

The `url` param is set for compatibility reasons related to `localStorage`, and `resources` and `runScripts` are set by default so that external scripts work as expected.
The `url` param is set for compatibility reasons related to `localStorage`, and `resources` and `runScripts` are set by default so that external scripts work as expected.
## Unsafe Mode
By default, JSDOM is called with `runScripts: 'outside-only'`. Set `global.UNSAFE_MODE` before your `require('enable-window-document')` call to enable dangerous mode and execute external scripts when added to DOM.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc