CSV File download in a custom app via anchor tag not working for Chrome 83.x version

CSV File download is not working in custom app for Chrome 83.x version. 

 

I was using the download via creating an anchor with download attribute and which was working fine before. But after upgrading the Chrome to new version it is not working.

 

Kindly, provide any information on alternate way where we can download files using DOMO methods.

 

Thanks in advance.

Best Answer

Answers

  • can you link some sample code here?

    Jae Wilson
    Check out my 🎥 Domo Training YouTube Channel 👨‍💻

    **Say "Thanks" by clicking the ❤️ in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"
  • export function downloadCsv(csvString: string, opts: ExportCsvOpts = defaultExportCsvOpts): void {
    const BOM = "\uFEFF"; // its neded to aprse japanese signs
    const csvBlob = new Blob([`${BOM}${csvString}`], { type: "text/csv;charset=utf-8" });
    const fileName = `${opts.fileName}.csv`;
    if (navigator.msSaveBlob) {
    navigator.msSaveBlob(csvBlob, fileName);
    } else {
    const a = document.createElement("a");
    a.href = URL.createObjectURL(csvBlob);
    a.download = fileName;
    a.style.visibility = "hidden";
    a.click();
    }
    }

    Hi JaeW,

     

    Here is the JS code which I was using to download a file as CSV. This was working fine until a new update in Chrome 83.x came. Please, let me know if there are any solutions.

     

    Thanks for your response..

  • jaeW_at_Onyx
    jaeW_at_Onyx Coach
    Answer ✓

    As i understand it the iframes in Domo apps are all sandboxed as a security feature, hence why this would stop working (see linked article).  I don't know of a workaround, this might be a question to direct at the apps team via support.

    https://www.androidpolice.com/2020/04/17/chrome-beta-83-revamps-form-controls-blocks-downloads-from-sandboxed-content-and-more-apk-download/

    Other features

    As always, Chrome 83 includes changes for both users and developers. Here are some smaller changes in this update:

     
    • The new @supports selector() feature makes it easier to check if a CSS feature is supported before it is used.
    • The Barcode Detection API is now enabled by default.
    • Downloads from sandboxed iframes are now blocked, preventing malicious ads and other embedded content from downloading files.
    Jae Wilson
    Check out my 🎥 Domo Training YouTube Channel 👨‍💻

    **Say "Thanks" by clicking the ❤️ in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"
  • Thank you so much for your response. I will look for any other solution in this case.

This discussion has been closed.