3.0.0 • Published 7 years ago
@sebgroup/document-write-intervene v3.0.0
document-write-intervene
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-interveneExample
const { intervene } = require('@sebgroup/document-write-intervene')
intervene()Testing
Unit tests:
$ npm tE2E tests:
- Chrome tests:
$ npm run webdriver:chromeand then
$ npm run e2e:chrome- Internet Explorer tests:
$ npm run webdriver:ieand then
$ npm run e2e:ie