plnkr / feedback

Feedback on Plunker
19 stars 11 forks source link

Chrome v83 Download is disallowed warning #534

Closed yusufkayaer closed 4 years ago

yusufkayaer commented 4 years ago

Describe the bug I get the following error when downloading excel file.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://plnkr.co/edit/Qi8U7NRaG1kiuGLT?preview link'
  2. Click on 'api.exportDataAsExcel(params) buttons'
  3. See error below

Errors / logs in developer tools

Download is disallowed. The frame initiating or instantiating the download is sandboxed, but the flag ‘allow-downloads’ is not set. See https://www.chromestatus.com/feature/5706745674465280 for more details.

Expected behavior

Screenshots

Desktop (please complete the following information):

Additional context

ggoodman commented 4 years ago

@yusufkayaer thanks for bringing this to my attention. I've released a new version where allow-downloads is set on the iframes' sandbox atributes (there are two levels of iframes).

recoba137 commented 4 years ago

@ggoodman I got this issue too. My front-end uses Angular and don't know where to set allow-downloads. Can you share your idea

daniel-dimitrovv commented 4 years ago

I have the same issue. Please refer to https://stackoverflow.com/questions/62425400/angular-9-download-is-disallowed-the-frame-initiating-or-instantiating-the-do

recoba137 commented 4 years ago

I have the same issue. Please refer to https://stackoverflow.com/questions/62425400/angular-9-download-is-disallowed-the-frame-initiating-or-instantiating-the-do

I found the problem. In my case, it is not related to front-end. It is caused by config of web server The config has Content Security Policy setting is sandbox and not include 'allow-downloads' Have just included it and it worked.

My web server is using Nginx Where to include? conf file: add_header Content-Security-Policy ... sandbox allow-downloads Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP