Add support for PhantomJS 1.6 onUrlChanged and onNavigationRequested events #151

Closed
n1k0 opened this Issue Jun 21, 2012 · 1 comment

1 participant

@n1k0
CasperJS member

Reference PhantomJS commit: ariya/phantomjs@40fd210

CasperJS API should look like that:

casper.on('url.changed', function(url) {
    // stuff
});

casper.on('navigation.requested', function(url, navigationType, navigationLocked, isMainFrame) {
    // stuff
});

For the records, available navigation types are:

  • LinkClicked
  • FormSubmitted
  • BackOrForward
  • Reload
  • FormResubmitted
  • Other

So we could have more specific events like form.submitted, form.resubmitted, etc.

Note: let's check for BC compatibility with existing events.

@n1k0 n1k0 was assigned Jun 21, 2012
@n1k0 n1k0 closed this Jun 24, 2012
@n1k0 n1k0 reopened this Jun 24, 2012
@n1k0
CasperJS member

implemented by 95ea184 & 86e28db

@n1k0 n1k0 closed this Jun 24, 2012
@hubpan hubpan pushed a commit to hubpan/casperjs that referenced this issue Feb 7, 2014
@detro detro Handling "window opening" in PhantomJS.
This addresses [Issue #151](http://code.google.com/p/phantomjs/issues/detail?id=151).

Summary of the new API:
- page.pages[]
- page.pagesWindowName[]
- page.getPage(windowName)
- page.windowName
- page.onPageCreated = function(newPage) { ... }

The page object created by the user holds responsibility of the "child" pages it creates.
If a page closes (i.e. window.close()) or a call to "page.pages[i].release()" is done,
the array "page.pages[]" will automatically update to contain only the pages still open.
5f0ed88
@hubpan hubpan pushed a commit to hubpan/casperjs that referenced this issue Feb 7, 2014
@detro detro Adding property "page.ownsPages".
When set to "true", any page that gets created, is
owned by the "page" that control it's lifetime.
Also, the pages can be found in the "page.pages[]" array.

Default value is "true".

Addresses [Issue #151](http://code.google.com/p/phantomjs/issues/detail?id=151)
733d210
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment