Cypress began to inject additional markup into the downloaded csv, tsv & txt files (after v. 10.9.0)
See original GitHub issueCurrent behavior
Downloaded or opened in the new tab csv, tsv or txt file contains a very long markup code before the actual content of the file, for example
<head> <script type='text/javascript'> document.domain = 'mydomain.us'; const cypressConfig = { modifyObstructiveThirdPartyCode: false, modifyObstructiveCode: true }; !function(a){var o={};function e(i){if(o[i])return o......(178000 more characters).....,0:function(a,o,e){a.exports=e("./injection/cross-origin.js")}}); </script> </head>
column_name | table_name | value_type | encoding_id | ordaunits | notes |
---|---|---|---|---|---|
ins_index | deatch | 11 | 0 | 1 | A numerical index used to distinguish the cases where we have multiple death records for a participant. |
date_of_death | death | 51 | 0 | 4 | Date of death |
dsource | death | 41 | 1970 | 2 | The data source is either E/W for England & Wales or SCOT for Scotland. |
eid | death | 11 | 0 | 0 | This identifier is the same encoded id used in the main dataset. |
source | death | 11 | 261 | 3 | The particular data format in which this record was received. |
Desired behavior
Downloaded file should not contain any <head><script></script><head> markup.
It should contain actual csv/tsv/txt content, for example:
column_name table_name value_type encoding_id orda units notes
ins_index deatch 11 0 1 A numerical index used to distinguish the cases where we have multiple death records for a participant.
date_of_death death 51 0 4 Date of death
dsource death 41 1970 2 The data source is either E/W for England & Wales or SCOT for Scotland.
eid death 11 0 0 This identifier is the same encoded id used in the main dataset.
source death 11 261 3 The particular data format in which this record was received.
The issue started to happen after we updated Cypress from 10.8.0 to 10.9.0. Also occurs in Cypress 10.10.0
Test code to reproduce
cy.readFile("downloads/record_column.csv").then((text) => {
cy.readFile("./fixtures/bencmarkFiles/record_column.csv").should("eq", text);
});
Cypress Version
^10.8.0
Node version
16.13.1
Operating System
macOS 12.5.1
Debug Logs
No response
Other
Sadly, the issue is not reproducible when we’re trying to download sample CSVs from here: https://www.sample-videos.com/download-sample-csv.php , it happens only on our product, which is closed to the public 😦
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
CSV file downloaded with Cypress has additional markup in it
My problem is that the one that Cypress is downloading seems to have markup added to the file. <head> <script type='text/javascript'> document.
Read more >CSV & TSV Upload Issues - Qualtrics
Download your CSV file from Qualtrics. · Open the file in Excel. · Select the first column in your spreadsheet. · Select the...
Read more >Import or export text (.txt or .csv) files - Microsoft Support
Go to File > Open and browse to the location that contains the text file. · Select Text Files in the file type...
Read more >Rainbow CSV - Visual Studio Marketplace
Extension for Visual Studio Code - Highlight CSV and TSV files, Run SQL-like queries.
Read more >Untitled
Michael v meme, Latkovy luster, Svadba humenne 2013, What's in standard right now mtg, Katten uit kerstboom houden, Sim klugerman?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kryshenp looks like it is injection on
text/plain
, which doesn’t seem right. Thank you for sending those over!Yeah, I see the “fullCrossOrigin” in my output.