{"_id":"frames","_rev":"269121","name":"frames","description":"Frames allows you to create pre-configured iframes. While providing a common interface to interact with the iframe's contents.","dist-tags":{"latest":"0.0.1"},"maintainers":[{"name":"3rdeden","email":""},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":""},{"name":"v1","email":""}],"time":{"modified":"2023-06-28T12:14:14.000Z","created":"2013-12-18T10:39:57.556Z","0.0.1":"2014-10-10T11:49:11.534Z","0.0.0":"2013-12-18T10:39:57.556Z"},"users":{},"author":{"name":"Arnout Kazemier"},"repository":{"type":"git","url":"https://github.com/bigpipe/frames"},"versions":{"0.0.1":{"name":"frames","version":"0.0.1","description":"Frames allows you to create pre-configured iframes. While providing a common interface to interact with the iframe's contents.","main":"index.js","repository":{"type":"git","url":"https://github.com/bigpipe/frames"},"keywords":["iframe","sandbox","frames"],"author":{"name":"Arnout Kazemier"},"license":"MIT","bugs":{"url":"https://github.com/bigpipe/frames/issues"},"gitHead":"e93ba45f254ca23568330f925e0cb4da7e05690a","homepage":"https://github.com/bigpipe/frames","_id":"frames@0.0.1","scripts":{},"_shasum":"58bd087b5eda848f03b600aa9f77eafdc1b30e93","_from":".","_npmVersion":"1.4.27","_npmUser":{"name":"V1","email":"info@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":""},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":""},{"name":"v1","email":""}],"dist":{"shasum":"58bd087b5eda848f03b600aa9f77eafdc1b30e93","size":2533,"noattachment":false,"key":"/frames/-/frames-0.0.1.tgz","tarball":"http://name.csiicloud.com:7001/frames/download/frames-0.0.1.tgz"},"directories":{},"_cnpmcore_publish_time":"2021-12-19T13:24:31.196Z","publish_time":1412941751534,"_cnpm_publish_time":1412941751534},"0.0.0":{"name":"frames","version":"0.0.0","description":"Frames allows you to create pre-configured iframes. While providing a common interface to interact with the iframe's contents.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/3rd-Eden/frames"},"keywords":["iframe","sandbox"],"author":{"name":"Arnout Kazemier"},"license":"MIT","bugs":{"url":"https://github.com/3rd-Eden/frames/issues"},"_id":"frames@0.0.0","dist":{"shasum":"22ba13f458545567e4cf5feb546b989b9dfbdae6","size":2540,"noattachment":false,"key":"/frames/-/frames-0.0.0.tgz","tarball":"http://name.csiicloud.com:7001/frames/download/frames-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"V1","email":"info@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":""},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":""},{"name":"v1","email":""}],"directories":{},"_cnpmcore_publish_time":"2021-12-19T13:24:30.882Z","publish_time":1387363197556,"_cnpm_publish_time":1387363197556}},"readme":"# Frames\n\nFrames is a simple helper function that creates a pre-configured iframe and\nappends it to the given DOM element while providing a nice API for interacting\nwith the iframe.\n\nThis module assumes that it's used by a Node.js compatible module system.\n\n## Installation\n\n```\nnpm install frames --save\n```\n\n## Usage\n\nThe reason why we've decided to go with methods that exposes the properties vs\njust exposing a `document` and `window` property is that these values and their\nreferences change when you remove and add the iframe back in the DOM.\n\nThere are 2 requirement arguments when you create a new iframe:\n\n1. The parentNode where the iframe should be appended to.\n2. A unique id for the iframe. This id will also be used for the `name`\n   attribute.\n\nThe third argument is the options argument which can be used to configure:\n\n- `visible`: This hides the iframe by giving it a display none and positions it\n  outside the document using absolute positioning. Defaults to `true`\n- `sandbox`: These values are used to set the `sandbox` attribute on the iframe.\n  It defaults to: `[allow-pointer-loc, allow-same-origin, allow-scripts, allow,\n  popups, allow-forms]`\n\nThe module exposed as single function, so it can be used like this:\n\n```js\n'use strict';\n\nvar iframe = require('frames');\n\n//\n// Create a new iframe and add which will be added to the `document.body`\n//\nvar frame = iframe(document.body, 'foo_'+ Date.now());\n```\n\nThe following methods are exposed on the returned object:\n\n### frame.document()\n\nThe `document` method returns the `document` of the created iframe. This can be\nused to inject elements in the HTML of the iframe.\n\n### frame.window()\n\nThe `window` method can be used to return the `window` or `global` of the\niframe. This allows you to introduce new variables in the iframe as well as see\nwhich globals are exposed within the iframe.\n\n### frame.add()\n\nAdds the `iframe` element to initially supplied parentNode. It will only add the\nelement if it wasn't already in the DOM.\n\n### frame.remove()\n\nRemove the `iframe` element from the parentNode. This causes the iframe to\ntrigger an `unload` event in the browsers that support it. (Basically every\nbrowser except older Opera browsers).\n\n### frame.attached()\n\nCheck if the `iframe` has been added to the parentNode.\n\n### frame.frame\n\nReference to the created DOM node, which can be used for all other kinds of\ninteractions.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/bigpipe/frames","bugs":{"url":"https://github.com/bigpipe/frames/issues"},"license":"MIT"}