Skip to content

Commit

Permalink
Add page.create() to allow multiple pages
Browse files Browse the repository at this point in the history
This adds a new feature, `page.create()` that allows for there to be
multiple pages. Calling `page.create(options)` create a new page
function that behaves just like the global page. It contains its own
internal state, options, and event handlers. You can target the page to
another window, like an iframe or a popup, if you want.

```js
var newPage = page.create({
  window: someIframe.contentWindow
});
```

The main reason for adding this feature was to clean up or testing
infrastructure. Numerous things had to be done in the past to make sure
each test was cleanly in isolation. That stuff is no longer necessary
now that we can just create a new page instance for each test.

Closes #13
  • Loading branch information
matthewp authored and matthewpblog committed Sep 6, 2018
1 parent cc40bc4 commit 2447b23
Show file tree
Hide file tree
Showing 5 changed files with 1,409 additions and 1,187 deletions.
3 changes: 2 additions & 1 deletion .jshintrc
Expand Up @@ -20,5 +20,6 @@
"trailing": false,
"smarttabs": true,
"latedef": false,
"indent": 2
"indent": 2,
"validthis": true
}

0 comments on commit 2447b23

Please sign in to comment.