Vaadin 8下载选项在Chrome 76中不起作用

时间:2019-10-01 07:42:29

标签: google-chrome amazon-ec2 download vaadin vaadin8

我们正在使用vaadin 8,并使用iframe下载csv选项。每当我尝试下载时,都会出现以下错误。但是,它在本地系统上运行良好。我们正在为此应用程序使用spring boot。以及适用于开发和质量保证服务器的AWS。

请提出解决方案。

[干预]不允许在未经用户激活的情况下在广告框中下载。有关更多详细信息,请参见https://www.chromestatus.com/feature/6311883621531648

下面是我们使用的Vaadin库的代码段

 fileDownloader = new FileDownloader(streamResource) {
             @Override
             public boolean isOverrideContentType() {
                 return false;
             }
         };
         fileDownloader.extend(this); 

 public void download(ClickEvent clickEvent) {
        executeDownload();
    }

    private void executeDownload() {
        if (getParent() == null) {
            throw new RuntimeException("OnclickDownloadComponent has to be attached to a UI in order to work properly. " +
                    "It is set to display=none to make it invisible but it has to be rendered on the page.");
        }
        Page.getCurrent().getJavaScript().execute("document.getElementById('" + styleId + "').click();");
    }

0 个答案:

没有答案