Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The href of a link processsed incorrectly in an iframe without src if it is set from the main window #620

Closed
AlexanderMoskovkin opened this issue Jun 4, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@AlexanderMoskovkin
Copy link
Contributor

There is an iframe

<iframe id="iframe"></iframe>

If I create a link inside the iframe in the following way:

// This code executes in the context of the top window
var iframe = document.getElementById('iframe');
var body = iframe.contentDocument.body;

body.innerHTML = '<a href="somePage.html">link</a>';

the link has processed href without the iframe flag. As I result, when I click on it, the new page in the iframe has task.js script instead of iframe-task.js.

If I do it in the other way:

// This code executes in the context of the top window
 var iframeDocument = document.getElementById('iframe').contentWindow.document;

var link = iframeDocument.createElement('a');

link.textContent = 'link';
link.href = 'somePage.html';
iframeDocument.body.appendChild(link);

it works ok in chrome and ie, but still broken in firefox.

@LavrovArtem
Copy link
Contributor

I'm working on this

@LavrovArtem
Copy link
Contributor

The second case doesn't reproduce

LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Aug 30, 2016
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Aug 30, 2016
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Aug 31, 2016
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Aug 31, 2016
@churkin churkin added this to the Sprint #2 milestone Nov 2, 2016
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Nov 28, 2016
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Nov 29, 2016
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Nov 29, 2016
@miherlosev miherlosev modified the milestones: Sprint #3, Sprint #2 Dec 1, 2016
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Dec 6, 2016
@LavrovArtem LavrovArtem assigned LavrovArtem and unassigned churkin Dec 7, 2016
LavrovArtem added a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Dec 16, 2016
AndreyBelym pushed a commit to AndreyBelym/testcafe-hammerhead that referenced this issue Feb 28, 2019
@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked Issues that were automatically locked by the Lock bot label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants