{"_id":"iframe","_rev":"31-4777f8e0337ff36029db2f45f6357441","name":"iframe","time":{"modified":"2022-06-19T00:18:03.532Z","created":"2013-02-04T22:13:06.700Z","0.0.1":"2013-02-04T22:13:08.723Z","0.0.2":"2013-02-05T00:05:35.282Z","0.1.0":"2014-01-01T19:56:22.104Z","0.1.1":"2014-01-01T20:23:36.196Z","0.1.2":"2014-01-01T20:46:58.644Z","0.1.3":"2014-06-05T05:26:00.525Z","0.2.0":"2014-09-05T21:19:26.784Z","0.3.0":"2014-10-20T11:37:44.188Z","0.3.1":"2015-02-02T21:35:23.636Z","2.0.0":"2016-03-22T23:32:23.110Z","0.0.1-security":"2016-03-23T22:09:24.498Z","1.0.0":"2016-04-09T01:18:20.694Z"},"maintainers":[{"name":"tehshrike","email":"me@JoshDuff.com"}],"dist-tags":{"latest":"1.0.0"},"readme":"# iframe\n\nhigher level api for creating and removing iframes in browsers\n\n[![browser support](https://ci.testling.com/npm-dom/iframe.png)](https://ci.testling.com/npm-dom/iframe)\n\n[![NPM](https://nodei.co/npm/iframe.png)](https://nodei.co/npm/iframe/)\n\n## usage\n\nuse with [browserify](http://browserify.org)\n\n```\nnpm install iframe\n```\n\n```javascript\nvar iframe = require('iframe')\n\n// creates a new iframe and appends it to the container\nframe = iframe({ container: document.querySelector('#container') , body: \"hi\" })\n\n// completely removes previous iframe from container and generates a new one\nframe.setHTML({ body: \"bye\" })\n```\n\n## options\n\nyou can pass this into the constructor or `setHTML`\n\n```\n{\n  name: name of the iframe,\n  src: if src url is passed in use that (this mode ignores body/head/html options),\n  body: string contents for `<body>`\n  head: string contents for `<head>`\n  html: string contents for entire iframe\n  container: (constructor only) dom element to append iframe to, default = document.body\n  sandboxAttributes: array of capability flag strings, default = ['allow-scripts']\n  scrollingDisabled: (constructor only) boolean for the iframe scrolling attr\n}\n```\n\nyou can also just pass in a string and it will be used as `{html: 'yourstring'}`\n\n### security\n\nby default the sandbox attribute is set with 'allow-scripts' enabled. pass in an array of capability flag strings. [Available flags](http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/):\n```\nallow-forms allows form submission.\nallow-popups allows (shock!) popups.\nallow-pointer-lock allows (surprise!) pointer lock.\nallow-same-origin allows the document to maintain its origin; pages loaded from https://example.com/ will retain access to that origin’s data.\nallow-scripts allows JavaScript execution, and also allows features to trigger automatically (as they’d be trivial to implement via JavaScript).\nallow-top-navigation allows the document to break out of the frame by navigating the top-level window.\n```\n\n## gotchas\n\niframes are weird. here are some things I use to fix weirdness:\n\n### loading javascript into iframes\n\n```javascript\n// setTimeout is because iframes report inaccurate window.innerWidth/innerHeight, even after DOMContentLoaded!\nvar body = '<script type=\"text/javascript\"> setTimeout(function(){' + javascriptCodeHere + '}, 0)</script>'\n```\n\n### getting rid of dumb iframe default styles\n\n```javascript\nvar head = \"<style type='text/css'> html, body { margin: 0; padding: 0; border: 0; } </style>\"\n```\n\n## license\n\nBSD\n","versions":{"2.0.0":{"name":"iframe","version":"2.0.0","description":"","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"ISC","_id":"iframe@2.0.0","_shasum":"b2ef6ea7e7166a7b2536edd5faf5f7669f6d5949","_from":".","_npmVersion":"3.7.2","_nodeVersion":"4.3.0","_npmUser":{"name":"nj48","email":"spam@njohnson.me"},"dist":{"shasum":"b2ef6ea7e7166a7b2536edd5faf5f7669f6d5949","tarball":"https://registry.npmjs.org/iframe/-/iframe-2.0.0.tgz","integrity":"sha512-P1oVm5knbHZd3BKq6PU98glhib8sOoj4F0vsCV864naKlw53KDYcOMcJPhUvg+eTaqvE5cw315+dRzpvlkb5Wg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG7a/sscJRvgI9nRnKgrHgC15FYcADtOCIUlUe0qroT9AiEA3P6K1psc6lvavM2Fzq7+/4jMrgfOmpUEwkVRMyEHckU="}]},"maintainers":[{"name":"nj48","email":"spam@njohnson.me"}],"directories":{}},"0.0.1-security":{"name":"iframe","version":"0.0.1-security","description":"This package name is not currently in use, but was formerly occupied by a popular package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/npm/security-holder.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/npm/security-holder/issues"},"homepage":"https://github.com/npm/security-holder#readme","gitHead":"d1719e2a152734ed854065de56039770c9104d83","_id":"iframe@0.0.1-security","_shasum":"8bff68f6a4e9a732b94c8efbb03e5b2baa39ba63","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.1.0","_npmUser":{"name":"npm","email":"npm@npmjs.com"},"dist":{"shasum":"8bff68f6a4e9a732b94c8efbb03e5b2baa39ba63","tarball":"https://registry.npmjs.org/iframe/-/iframe-0.0.1-security.tgz","integrity":"sha512-GItpm9ThWuAjg8rIPkRsFf7zzzEsOX5Ua2bAiuv2O/4iiSvhXzzTaNSzThf4C9CjHFbf4wJIPXpknpxKFkeQag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEGgJv6HB4jU/DMbSHG6Bz6ezvElwOq88Qz5brgOoMGUAiBFvpT8tuzJ0O2cnx4b9Yi0oEJHaU5T8qL6XbTxwNlG3Q=="}]},"maintainers":[{"name":"nj48","email":"spam@njohnson.me"}],"directories":{}},"0.0.1":{"name":"iframe","version":"0.0.1","description":"higher level api for creating and using iframes in browsers","repository":{"type":"git","url":"git@github.com:maxogden/iframe.git"},"engines":{"node":"0.8.x"},"_id":"iframe@0.0.1","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"49272130e70af592c45b9c80fc8111903b975665","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"49272130e70af592c45b9c80fc8111903b975665","tarball":"https://registry.npmjs.org/iframe/-/iframe-0.0.1.tgz","integrity":"sha512-Z7F9zuHsm+hQNVfHyNoaXOjAsXIk7Q0in6K7dWPttruG8CnxiqFFQhNiWdt+dlfGpoFO+cs0YjSLWE2kvq9SFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFCr1dsd76UdTIj0Wt/6/Uu/4TUaSGRZTpNLv7vs/au6AiBWCZOE9/vvLmXRWTRvXcPP4rROY9iuk0JOA7tNZVPsDQ=="}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}]},"0.0.2":{"name":"iframe","version":"0.0.2","description":"higher level api for creating and using iframes in browsers","repository":{"type":"git","url":"git@github.com:maxogden/iframe.git"},"engines":{"node":"0.8.x"},"_id":"iframe@0.0.2","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"54072057b17f927beb5ada6688624633f62f39ac","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"54072057b17f927beb5ada6688624633f62f39ac","tarball":"https://registry.npmjs.org/iframe/-/iframe-0.0.2.tgz","integrity":"sha512-XIPr5eEmXBcTvNizqh2n8HnC+LlmMe6Lbf6NCkjS2vjRooRjPHuK0YHcBysBSN9VAs08I4OQ+TbDFOZe3v9zWQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxknyqiymSk68Zv6IohBUcisni803FAGZ1Q4y+meRkvgIhAOnXOSA5Q8aJIMNuZfDTQ3o6SSJmSE9k7cozVngHUI68"}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}]},"0.1.0":{"name":"iframe","version":"0.1.0","description":"higher level api for creating and using iframes in browsers","repository":{"type":"git","url":"git@github.com:maxogden/iframe.git"},"engines":{"node":"0.8.x"},"devDependencies":{"tape":"~2.3.2"},"testling":{"files":"test.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"_id":"iframe@0.1.0","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"662b7b15c9e32126ff39736fe7f1c3567825420a","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"662b7b15c9e32126ff39736fe7f1c3567825420a","tarball":"https://registry.npmjs.org/iframe/-/iframe-0.1.0.tgz","integrity":"sha512-36BQE7kV0LxaBNeJjFclcGqwZ7i3y9/eC4plUCQrWvR1ez6lI7D2Qmg0RY37CShmor1J/nqw2d3xMkivQCWsNA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4ol5YSv2L1AxaDp6kswH0vJPyyKJ00eTRrjErTEL49gIgV6eyb54yg4n2i17/Deo/j6i+wIy37ZoWyDvIgqFt1lM="}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}]},"0.1.1":{"name":"iframe","version":"0.1.1","description":"higher level api for creating and using iframes in browsers","repository":{"type":"git","url":"git@github.com:maxogden/iframe.git"},"engines":{"node":"0.8.x"},"devDependencies":{"tape":"~2.3.2","domready":"~0.2.13"},"testling":{"files":"test.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"_id":"iframe@0.1.1","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"f9d35fecff0ceafe780af1320c7f9fe3a9a909a3","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"f9d35fecff0ceafe780af1320c7f9fe3a9a909a3","tarball":"https://registry.npmjs.org/iframe/-/iframe-0.1.1.tgz","integrity":"sha512-1JfOLE0GOUs7nrTDPrDvv0XxefVxd8mkpZ6zFZuIFi2MKi0FvdKJuJqXrK8zBMVAcqkTgsGXOsdXGceEO7H0fA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQ0MBjtc3VPOF4qR6WN2ol+r4g7wzwOtxIejK3c1pAKAIhAKstsdRQDWyB2FbFmFLqyt7cH9SV4IEgykzp373CNfDl"}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}]},"0.1.2":{"name":"iframe","version":"0.1.2","description":"higher level api for creating and using iframes in browsers","repository":{"type":"git","url":"git@github.com:maxogden/iframe.git"},"engines":{"node":"0.8.x"},"devDependencies":{"tape":"~2.3.2","domready":"~0.2.13"},"testling":{"files":"test.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"_id":"iframe@0.1.2","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"43423aa2fa9449e069476703351a787d8bb479a9","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"43423aa2fa9449e069476703351a787d8bb479a9","tarball":"https://registry.npmjs.org/iframe/-/iframe-0.1.2.tgz","integrity":"sha512-4HLvfKn8hXtRK6otULLe6iPPok+KvnWL8HLzCcC3CstxKMK0AAiMOgtTk9QApgZfnlVSHJYuyjuvgNLa+clycQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZgkHzvBTUlYA78dwmpPhRbzkSNB9aZTlxW4dprtx6YQIgVLJonL+9xTgTu1VfyxwuJblB+Qf9APP4rl1+mxLEhVw="}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}]},"0.1.3":{"name":"iframe","version":"0.1.3","description":"higher level api for creating and using iframes in browsers","repository":{"type":"git","url":"git@github.com:npm-dom/iframe.git"},"devDependencies":{"tape":"~2.3.2","domready":"~0.2.13"},"testling":{"files":"test.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"bugs":{"url":"https://github.com/npm-dom/iframe/issues"},"homepage":"https://github.com/npm-dom/iframe","main":"index.js","author":"max ogden","license":"BSD","_id":"iframe@0.1.3","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"2d00c7cf34e685f9287eb2e3ea248d76b2c0281d","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"2d00c7cf34e685f9287eb2e3ea248d76b2c0281d","tarball":"https://registry.npmjs.org/iframe/-/iframe-0.1.3.tgz","integrity":"sha512-uTDyKExD4SD5F6Q2L85ptjvohYZ7oI3O1Fv3O8xVgX0PWE5KmyK0eT+oylmYUwBKVIo9N4JlkPXYzRWg/5aouQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICWz8dgsszoeubWUs4aDV/oQKkdxcSIRsSHA6oWKlX6vAiAW5MpQIzdBzJ9+UntdR5C3YwSvw+e+B7Md9ICctomGCA=="}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}]},"0.2.0":{"name":"iframe","version":"0.2.0","description":"higher level api for creating and using iframes in browsers","repository":{"type":"git","url":"git@github.com:npm-dom/iframe.git"},"devDependencies":{"tape":"~2.3.2","domready":"~0.2.13"},"testling":{"files":"test.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"bugs":{"url":"https://github.com/npm-dom/iframe/issues"},"homepage":"https://github.com/npm-dom/iframe","main":"index.js","author":"max ogden","license":"BSD","_id":"iframe@0.2.0","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"138d836c7a22613593cd94bc6a46c497ea56b719","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"138d836c7a22613593cd94bc6a46c497ea56b719","tarball":"https://registry.npmjs.org/iframe/-/iframe-0.2.0.tgz","integrity":"sha512-STc7sWQ6200kA1cilRx0Dtb9pppgAdgsDDxUvyP1vaOJPk8n5HOjeA1UWREDIkYB9MfFfT36/5vtgMlicPnlDA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKOThhS+U9rXH4HZEYHf7LdXqcSFvmLkA9cUXe8pNQGQIhALHULvCBdv4zqOi382seQ2CzrCpWBHXiea89HXyf1Z24"}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}]},"0.3.0":{"name":"iframe","version":"0.3.0","description":"higher level api for creating and using iframes in browsers","repository":{"type":"git","url":"git@github.com:npm-dom/iframe.git"},"devDependencies":{"tape":"~2.3.2","domready":"~0.2.13"},"testling":{"files":"test.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"bugs":{"url":"https://github.com/npm-dom/iframe/issues"},"homepage":"https://github.com/npm-dom/iframe","main":"index.js","author":"max ogden","license":"BSD","_id":"iframe@0.3.0","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"d84f5c8100c9643ebef03e374f4e047fbfcf1d0f","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"d84f5c8100c9643ebef03e374f4e047fbfcf1d0f","tarball":"https://registry.npmjs.org/iframe/-/iframe-0.3.0.tgz","integrity":"sha512-4uiMCA7JHnEqYMRnO5MzznvGmHm+KJBFQelxgNL2SDrGxZPWEx5woj/osQzCYRYUsRa5cquO68wJ1U7CwpcbFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAEggaJtscdSTAIOdeH31efXaQYp1v7h0EVVxYM7u7TuAiEA0MsIUJnDwPtfEUXIqmTHE3ityxPY2PkI4gf1Em0QHMM="}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}]},"0.3.1":{"name":"iframe","version":"0.3.1","description":"higher level api for creating and using iframes in browsers","repository":{"type":"git","url":"git@github.com:npm-dom/iframe.git"},"devDependencies":{"tape":"~2.3.2","domready":"~0.2.13"},"testling":{"files":"test.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"bugs":{"url":"https://github.com/npm-dom/iframe/issues"},"homepage":"https://github.com/npm-dom/iframe","main":"index.js","author":"max ogden","license":"BSD","_id":"iframe@0.3.1","_npmVersion":"0.0.0-fake","_nodeVersion":"0.0.0-fake","_shasum":"19cf00463e9d44d2379597bd942f842d89d12fc8","_npmUser":{"name":"npm","email":"support@npmjs.com"},"_from":".","dist":{"shasum":"19cf00463e9d44d2379597bd942f842d89d12fc8","tarball":"https://registry.npmjs.org/iframe/-/iframe-0.3.1.tgz","integrity":"sha512-BPxbedtqMvPNwbcIpXkvnQkeDPwLoWB/Q9l67s2cDoiCRhiuMyp8Xo3H6yxsQ18FqRyz4r4sz7WJh16xO7FXeg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH5ZL6w37Usf7zAC8/eUVHC7b3gbeQZgjiIxSbjfl7iWAiAfjmPXWXanNkzjr4tzvPRxn2WeCB+pE8jQZpG/en/ZPw=="}]},"maintainers":[{"name":"npm","email":"npm@npmjs.com"}]},"1.0.0":{"name":"iframe","version":"1.0.0","description":"higher level api for creating and using iframes in browsers","repository":{"type":"git","url":"git+ssh://git@github.com/npm-dom/iframe.git"},"devDependencies":{"tape":"~2.3.2","domready":"~0.2.13"},"testling":{"files":"test.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"bugs":{"url":"https://github.com/npm-dom/iframe/issues"},"homepage":"https://github.com/npm-dom/iframe","main":"index.js","author":{"name":"max ogden"},"license":"BSD","gitHead":"ddd90913aea1f3798c6570c585f55916bae95cf5","_id":"iframe@1.0.0","scripts":{},"_shasum":"58e74822b178a0579d09cd169640fb9537470ef5","_from":".","_npmVersion":"3.8.0","_nodeVersion":"5.1.1","_npmUser":{"name":"tehshrike","email":"me@JoshDuff.com"},"maintainers":[{"name":"tehshrike","email":"me@JoshDuff.com"}],"dist":{"shasum":"58e74822b178a0579d09cd169640fb9537470ef5","tarball":"https://registry.npmjs.org/iframe/-/iframe-1.0.0.tgz","integrity":"sha512-Gn9nkImXrU8xQLvljaVnHFimYwBehKUcHoPG2YaWlXboA1rMsJ2uBzlN5kihaIbdami6PetBINnKR2rxS6GYig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqH17bHEVd3/J9erphqoti+LJcFTRfKY7oJaV1KJ2MvwIhAL9OJfvCpOWstN0oSQK1gk2YaPOUExIl1Jbb++N5Fqp4"}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/iframe-1.0.0.tgz_1460164699709_0.26476800185628235"}}},"license":"BSD","readmeFilename":"readme.md","description":"higher level api for creating and using iframes in browsers","homepage":"https://github.com/npm-dom/iframe","repository":{"type":"git","url":"git+ssh://git@github.com/npm-dom/iframe.git"},"bugs":{"url":"https://github.com/npm-dom/iframe/issues"},"author":{"name":"max ogden"},"users":{"larrychen":true}}