How to prevent iframe to change the context of the top-level view (top.history)?

I am trying to create some layout control web application that can host other child applications (single domain) in it.

Overview

Currently, the main application can track any navigation in the child application and save the navigation record in the main application. The user can click the "Back" or "Forward" button to go to the last page. Everything worked fine until I found code in a child application that programmatically changes a property location.hashor calls a method history.pushStatein a child application.

, . iframe ( ), . , , .

W3C

- active Document, , , , .

2 .

  • iframe? document.domain .

    • - "apps.site.com".
    • - "apps.site.com", "site.com", . , , iframe.
  • iframe /hashchange/pushState? - /, click . , , .

,

Ref: https://html.spec.whatwg.org/multipage/browsers.html#traverse-the-history

+4
1

, Chrome , , . : https://developer.chrome.com/apps/tags/webview

HTML5. .

Iframe .

0

All Articles