page.js v1.8.0 Release Notes

Release Date: 2018-01-17 // about 6 years ago
  • ๐Ÿ“š This is a minor release, adding one new (minor) feature and a few bug fixes and documentation improvements.

    Controlling other pages

    ๐Ÿš€ The new feature of this release is that page.js can now control other pages (windows) besides the main window. This makes it possible to control an iframe's routing. You can use it by passing the window option to start:

    page('/', function(){
      // Whoa, I'm inside an iframe!
    });
    

    page.start({ window: myiFrame.contentWindow });

    Note that page is still a singleton, which means you can only have 1 page, so you can't control both an iframe and the main window at the same time.

    โœ… This change was made to improve our testing, but in the future we'll make it possible to have multiple page objects so you really will be able to control multiple iframes and the main window all at the same time.

    ๐Ÿ‘ Better hashbang support

    ๐Ÿ›  Hashbang support has never been very good in page.js. But we're slowly improving it! In 1.8.0 we've fixed the problem where the app's full URL would show up in the hashbang upon start. http://example.com/my/page#!/my/page. Gross! No longer happens thanks to #447.

    Pull Requests

    ๐Ÿ”€ Those are the big things, but here's a list of all of the pull requests merged into 1.8.0:

    • #445 - Prevent hash from being part of the ctx.pathname
    • #447 - Prevent going to the root when setting up the initial hashchange route
    • #446 - Add a note about usage with a CDN
    • โœ… #443 - Change test infrastructure to run inside of iframes
    • #303 - page.exit callback example missing context param
    • #267 - Added clarification for decoded plus signs in urls