New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

document-write-html

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

document-write-html - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

8

lib/index.js

@@ -76,2 +76,3 @@ //var log = require('./logger.js');

var output = {
pre: '',
content: '',

@@ -92,3 +93,2 @@ style: '',

// todo look for <base> tag
var baseTagFound = false;

@@ -105,3 +105,3 @@ select('base', dom).forEach(function (baseTag) {

if (resourceUrlHandler && baseTagFound === false){
output.content += '<base href="'+resourceUrlHandler('./')+'" />';
output.pre += '<base href="'+resourceUrlHandler('./')+'" />';
}

@@ -207,2 +207,3 @@

return {
'pre': output.pre,
'content': output.content,

@@ -218,2 +219,5 @@ 'style': output.style,

var trimmed = parseAndResolve(base, html);
if (trimmed.pre){
str += toDocumentWrite(trimmed.pre);
}
if (trimmed.style) {

@@ -220,0 +224,0 @@ str += toDocumentWrite('<style>' + minifyCSS(trimmed.style) + '</style>');

{
"name": "document-write-html",
"version": "0.0.2",
"version": "0.1.0",
"description": "Convert a index.html page into document.writes. Why? Because most ad delivery systems do this - so nice to emulate *bad behaviour* for testing.",

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

@@ -103,5 +103,5 @@ var referee = require('referee');

assert.equals('document.write(\'<base href=\\"'+base+'\\" />'+expected+'\');', output);
assert.equals('document.write(\'<base href=\\"'+base+'\\" />\');document.write(\''+expected+'\');', output);
});
});
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