eligrey / eligrey/FileSaver.js

When used in an iframe in a different domain (or port) Chrome triggers "multiple files" warning/block

Open
#614 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
22k
Forks
4.3k
PR merge metrics
No merged PRs in 30d

Description

This also applies to other Chrome-based browsers, like Edge-dev.

Basically if FileSaver.js is used (a simple example like that shown in https://github.com/eligrey/FileSaver.js#saving-text will do it) inside an iframe from a different domain or port, it will cause Chrome to show the "download multiple files" warning.

![image](https://user-images.githubusercontent.com/29712657/71417193-f905ae80-265b-11ea-97d5-4f77e26279b9.png)

I couldn't create a jsfiddle as both HTML documents would be on the same domain and not trigger the issue, but it can be easily replicated downloading this zip file:
- [mutiple-downloads-issue-replication.zip](https://github.com/eligrey/FileSaver.js/files/3998570/mutiple-downloads-issue-replication.zip)

Inside there is basically these two HTML files, FileSaver.js, and a README with simple instructions to launch 2 Python localhost servers.

## index.html (http://localhost:8080/index.html)

```html



Test



This is part of the parent document. Below is the iframe.




```

## iframe/index.html (http://localhost:8090/index.html)

```html





Click me


document.getElementById("downloadLink").addEventListener("click", function foo(e) {
var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
saveAs(blob, "hello world.py");
});

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.