Skip to content

Commit

Permalink
0.1.0 - security improvements from #1
Browse files Browse the repository at this point in the history
  • Loading branch information
max-mapper committed Jan 1, 2014
1 parent 1f9b99a commit 814e928
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ IFrame.prototype.setHTML = function(opts) {
// generate HTML string
var htmlSrc = tempIframe.outerHTML
// insert HTML into container
this.container.insertAdjacentHTML('beforeend',htmlSrc)
this.container.insertAdjacentHTML('beforeend', htmlSrc)
// retrieve created iframe from DOM
var neighborIframes = this.container.querySelectorAll('iframe')
this.iframe = neighborIframes[neighborIframes.length-1]
Expand Down
21 changes: 20 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
{
"name": "iframe",
"version": "0.0.2",
"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"
]
}
}
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

higher level api for creating and removing iframes in browsers

[![browser support](https://ci.testling.com/maxogden/iframe.png)](https://ci.testling.com/maxogden/iframe)

[![NPM](https://nodei.co/npm/iframe.png)](https://nodei.co/npm/iframe/)

## usage

use with [browserify](http://browserify.org)
Expand Down
9 changes: 9 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var test = require('tape')
var iframe = require('./')

test('it adds an iframe to the document by default', function(t) {
t.equal(document.querySelectorAll('iframe').length, 0, 'no frames')
var frame = iframe({ body: 'hello world' })
t.equal(document.querySelectorAll('iframe').length, 1, 'one frame')
t.end()
})

0 comments on commit 814e928

Please sign in to comment.