Skip to content

Conversation

@bahmutov
Copy link
Contributor

@bahmutov bahmutov commented Sep 14, 2020

add example downloading local image and an image from another domain

Without chromeWebSecurity: false we get

Screen Shot 2020-09-14 at 5 53 15 PM

@bahmutov bahmutov requested a review from kuceb September 14, 2020 21:54
@bahmutov
Copy link
Contributor Author

@bkucera why would this trigger cross-domain error? I have seen for one user of ours "page loading..." that never resolves in this situation (see linked issue)

@kuceb
Copy link
Contributor

kuceb commented Sep 15, 2020

if the url is cross-origin, the download attribute will not have an affect. So the page is actually navigating. I would assume the image isn't downloaded

image
source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a

trying it out in a fiddle verifies that: https://jsfiddle.net/Le1kcn6q/1/

@bahmutov
Copy link
Contributor Author

Working in Chrome-based browsers is good in this case with chromeWebSecurity: false, the images are downloaded and checked

Screen Shot 2020-09-15 at 6 26 45 PM

@bahmutov bahmutov merged commit bedb8d6 into master Sep 15, 2020
@SidharthLala1
Copy link

@bahmutov So do we have a solution , i have already added "chromeWebSecurity": false in my cypress.json file.

What are the next steps to be followed to make this work. Please note that i am on cypress version # 4.12.1.

I hope that is not a problem.

@bahmutov
Copy link
Contributor Author

For now I have opened another PR #569 with cross-origin JS and TXT file downloads. Would be nice to have a cross-domain CSV file download, since the browser seems to handle CSV files differently.

flotwig added a commit that referenced this pull request Sep 28, 2020
@emilyrohrbough emilyrohrbough deleted the cross-domain-file-download branch November 22, 2022 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File download triggers page load wait

4 participants