I have a page which contains an iframe and I want to track the history of the iframe only. I tried to use the history object like this:
It's unlikely you will be able to access any objects associated with the frame because of the same-origin policy.
Have you tried setting the domains to be equal on the page itself and the iframe? e.g.
//somewhere on your page in a script tag
document.domain = "your-top-level-domain.com";
this should signal to the browser that the pages trust each other and should be given access to their internal state