Use the history object in an iframe

This prevents the cases where history.pushState and History.prototype.pushState are overwritten.
Do we use `window.history.pushState` any longer?  If not, can we simplify this to just the iframe check?