New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 814355 link

Starred by 3 users

Issue metadata

Status: Duplicate
Merged: issue 845923
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Doing window.history.back() from within an iframe has no effect

Reported by princess...@gmail.com, Feb 21 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36

Steps to reproduce the problem:
1. Have an <iframe/> element loading a page from a different domain
2. Navigate to another page within an iframe
3. Have a back button that should do `window.history.back()` when clicked

What is the expected behavior?
Navigate to previous page within an iframe.

What went wrong?
Executing `window.history.back()` or `window.history.go(-1)` doesn't do anything. History length remains unchanged. 

Did this work before? Yes 50.0.2661.108 (64-bit)

Does this work in other browsers? Yes

Chrome version: 64.0.3282.167  Channel: stable
OS Version: OS X 10.13.3
Flash Version:
 
Components: UI>Browser>Navigation

Comment 2 by creis@chromium.org, Feb 21 2018

Cc: creis@chromium.org clamy@chromium.org nasko@chromium.org
Thanks for the report.  Can you be more specific about the repro steps?  I have a few questions:

Should the load in step 1 complete before proceeding, or does it need to be in-progress?

Is the navigation in step 2 in the same iframe or a different one?  Is that expected to interrupt the navigation from step 1?

Is the button in step 3 in the main frame or one of the iframes?
Labels: Needs-Triage-M64
Labels: Needs-Feedback
Hi,

In step 1, navigation should finish.
In step 2, it's the navigation within the same iframe, just a different page. Page 1 -> page 2 -> page 3.
In step 3, the button is in the main frame. The two communicate via `postMessage`. Once a message is received, the `window.history.back()` should occur.
Owner: creis@chromium.org
Status: Assigned (was: Unconfirmed)
Mac triage: assigning to creis@ for followup or further triage.

Comment 7 by j...@basketful.co, May 21 2018

Here is a link to reproduce what I think is the same issue for me: https://github.com/jimlesch/ChromeIFrameHistoryFail
I am on Windows 10, Chrome version: 66.0.3359.181

I can repro this issue on my machine every time, but on another Windows 10, Chrome 66.0.3359.181 machine I can never reproduce this behavior, and history.go(-1) works as expected inside the iFrame.

Comment 8 by j...@basketful.co, May 21 2018

Additional Info: I cannot reproduce this issue in the latest Dev channel release of chrome: Version 68.0.3432.3 (Official Build) dev (64-bit) on Windows 10
I'm able to reproduce this on Chrome 67.0.3396.56 on Windows 10.  I posted the steps to reproduce with examples on this thread, I'll include the information here as well.

https://bugs.chromium.org/p/chromium/issues/detail?id=845923#c4

-------

I am able to confirm and reproduce this issue in Chrome 67.0.3396.56 on Windows 10.  When attempting to use window.history.back() or window.history.forward(), nothing appears to happen when inside an iframe from a different domain.  The window.onpopstate event does not fire either.  

I've setup two sites, one on glitch.me with buttons wired up to back(), forward(), and pushState().  These buttons work fine when you view the site here:

https://young-road.glitch.me/

Now, when I embed https://young-road.glitch.me/ inside an iframe on jsfiddle, the forward/back buttons no longer work, and the onpopstate event never fires.  Here is a link to the jsfiddle with the embedded iframe:  

https://jsfiddle.net/9p3nh3aj/

We have a production application which is embedded in an iframe that uses the history API.  It is currently broken in Chrome, but works in all other browsers.  Please let me know if there is any other info I can provide.

Comment 10 by j...@basketful.co, May 29 2018

After reading https://bugs.chromium.org/p/chromium/issues/detail?id=845923#c4
I have disabled "Site isolation trial opt-out" in chrome://flags/#enable-site-per-process
and the back button starts behaving as expected.

Comment 11 by creis@chromium.org, May 29 2018

Mergedinto: 845923
Status: Duplicate (was: Assigned)
Sorry that this fell through the cracks before!  lukasza@ has a fix in progress in  issue 845923 .

Comment 12 by j...@basketful.co, May 29 2018

Thanks for the update and the work to fix it.

Sign in to add a comment