Socket
Socket
Sign inDemoInstall

iframe

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iframe - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

16

index.js

@@ -30,8 +30,14 @@ module.exports = function(opts) {

opts = this.parseHTMLOptions(opts)
if (!opts.html) return
if (!opts.html && !opts.src) return
this.remove()
// create a blob for opts.html and set as iframe `src` attribute
var blob = new Blob([opts.html], { encoding: 'UTF-8', type: 'text/html' })
var U = typeof URL !== 'undefined' ? URL : webkitURL
var targetUrl = U.createObjectURL(blob)
// if src is passed in use that (this mode ignores body/head/html options)
if (opts.src) {
var targetUrl = opts.src
} else {
// create a blob for opts.html and set as iframe `src` attribute
var blob = new Blob([opts.html], { encoding: 'UTF-8', type: 'text/html' })
var U = typeof URL !== 'undefined' ? URL : webkitURL
var targetUrl = U.createObjectURL(blob)
}
// create temporary iframe for generating HTML string

@@ -38,0 +44,0 @@ // element is inserted into the DOM as a string so that the security policies do not interfere

{
"name": "iframe",
"version": "0.2.0",
"version": "0.3.0",
"description": "higher level api for creating and using iframes in browsers",

@@ -5,0 +5,0 @@ "repository": {

@@ -33,2 +33,3 @@ # iframe

{
src: if src url is passed in use that (this mode ignores body/head/html options),
body: string contents for `<body>`

@@ -35,0 +36,0 @@ head: string contents for `<head>`

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