Use unique iframe names based on unique domain#2955
Merged
jridgewell merged 3 commits intoampproject:masterfrom Apr 21, 2016
Merged
Use unique iframe names based on unique domain#2955jridgewell merged 3 commits intoampproject:masterfrom
jridgewell merged 3 commits intoampproject:masterfrom
Conversation
Browsers are weird. If an iframe has a `name` attribute, it’s window will be cached. When you click a link, then go back, it will insert the **same** src window into the iframe regardless of a different `src`. Well, that hurts us since we generate a unique domain to load 3p frames. We’ll continue to use an old domain’s window, even though the src points to a new domain. Worse, when we post messages to the 3p frame, we will send it with an origin parsed from the `src` attribute even though that is not the real URL of the frame’s window. Fixes ampproject#2943
Member
|
Thanks! Please add a test. |
Contributor
Author
|
Added. |
test/functional/test-3p-frame.js
Outdated
Member
There was a problem hiding this comment.
It'd be really good to hard code the actual name string in a test.
677468e to
da80c87
Compare
test/functional/test-3p-frame.js
Outdated
Member
|
LGTM |
da80c87 to
29a9b3d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Browsers are weird. If an iframe has a
nameattribute, it’s windowwill be cached. When you click a link, then go back, it will insert the
same src window into the iframe regardless of a different
src.Well, that hurts us since we generate a unique domain to load 3p
frames. We’ll continue to use an old domain’s window, even though the
src points to a new domain. Worse, when we post messages to the 3p
frame, we will send it with an origin parsed from the
srcattributeeven though that is not the real URL of the frame’s window.
Fixes #2943.