unFocus Projects

History Keeper – Deep Linking in Flash & JavaScript

Update: Beta 4 is out.

unFocus History Keeper – a JavaScript tool for managing browser history (back button) and deep linking in Flash and Ajax applications, enabling SEO.

You can check out an example page in SVN or check out adcSTUDO or Terminal Design’s fonts catalog for a demo. The test page contains a small JavaScript application that takes what you put in a text box, and makes a history entry out of it – a deep link will display that history entry in the body of the page as well.

Download the latest release archive from the downloads page on the google code site. You will find two packer compressed JavaScript files in the root of the archives, unFocus-History-p.js and unFocus-HistorySwf-p.js.

unFocus-History-p.js contains:

  • EventManager.js
  • History.js

unFocus-HistorySwf-p.js contains:

  • EventManager.js
  • History.js
  • FlashPlayerInfo.js
  • SwfUtilities.js
  • SwfHTML.js

NOTE: You should include only one of the two files, not both.

You can also check out the latest version from SVN from either the trunk (I try to keep it working there, but no guarantees) or one of the tagged releases (each release gets a tag) if you want to be cutting edge.

Features:

  • Enables back button support, for your client-side web apps!
  • Hash based deep linking (Anchor Style – index.html#/foo/bar)
  • Event driven – Event Dispatcher
  • Support for all current browsers:
    • Opera
    • Firefox
    • Safari 1.2+
    • IE 5.5+
    • Google Chrome

Known Limitations: (I have to confirm if many of these are still a problem)

  • All history entries (back button states) modify the location string.
  • Doesn’t remember last entry if you leave the app and come back in some browsers (that’s a bug, I’ll fix it).
  • Editing the url manually will stop further updates to the url in some browsers.
  • Konqueror support is still a bit flaky (this history is off by one in an odd way).
  • Deep linking and back  button functionality relies on ExternalInterface – so “allowScriptAccess” has to be set and working (platform defendant) for History Keeper to work (though you can actually get deep linking to work using flashvars, in a pinch).
  • Make sure whatever embed solution you are using, you have set the “id” attribute on your object or embed tag.

Related Links – Note: I’m trying to put links to everyone who helped me out over the years. If I left you out, please let me know.