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

@sebgroup/document-write-intervene

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sebgroup/document-write-intervene

Prevent document write from writing to your document and instead insert a new script to the dom.

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

document-write-intervene

Build Status Commitizen friendly semantic-release

Overwrites document.write function and will prevent it from clearing your document contents due to how document.write works when the document has been loaded.

It checks if the markup is a <script> tag and will load it asynchronous.

Otherwise it will insert the contents using insertAdjacentHTML on the body

Tested inside an Angular project.

It should work seamlessly with a React project.

Otherwise you could have a look at browserify to integrate it in your project

Installation

Install via npm:

$ npm install @sebgroup/document-write-intervene

Example

const { intervene } = require('@sebgroup/document-write-intervene')
intervene()

Testing

Unit tests:

$ npm t
E2E tests:
  • Chrome tests:
$ npm run webdriver:chrome

and then

$ npm run e2e:chrome
  • Internet Explorer tests:
$ npm run webdriver:ie

and then

$ npm run e2e:ie

FAQs

Package last updated on 23 Oct 2018

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

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