Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple onLoadFinished callbacks with no-op #24

Merged
merged 3 commits into from Sep 2, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{ {
"name": "grunt-lib-phantomjs", "name": "grunt-lib-phantomjs",
"description": "Grunt and PhantomJS, sitting in a tree.", "description": "Grunt and PhantomJS, sitting in a tree.",
"version": "0.3.0", "version": "0.4.0",
"homepage": "http://github.com/gruntjs/grunt-lib-phantomjs", "homepage": "http://github.com/gruntjs/grunt-lib-phantomjs",
"author": { "author": {
"name": "Grunt Team", "name": "Grunt Team",
Expand Down
3 changes: 3 additions & 0 deletions phantomjs/main.js
Expand Up @@ -118,6 +118,9 @@ page.onInitialized = function() {


// Run when the page has finished loading. // Run when the page has finished loading.
page.onLoadFinished = function(status) { page.onLoadFinished = function(status) {
// reset this handler to a no-op so further calls to onLoadFinished from iframes don't affect us
page.onLoadFinished = function() { /* no-op */}

// The window has loaded. // The window has loaded.
sendMessage('onLoadFinished', status); sendMessage('onLoadFinished', status);
if (status !== 'success') { if (status !== 'success') {
Expand Down