Setting "browser.sessionhistory.max_entries" to "2" is not worth the usability issues, I think (wearing a user hat). There should be a smarter approach.
Edit: Note: there may be other underlying issues with History API (which the pref has nothing to do with) such as history.pushState, where an attcker can find it useful to hide reflected XSS in the URL by dynamically changing the path to something less suspicious - e.g. http://samuli.hakoniemi.net/tag/history-pushstate/ - but that's out of scope for this ticket
We could think about keeping this ticket for further History API investigations and there is no need for pages knowing my session history length, really.