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>` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7171
92
77