I've a html page that generate a csv with the following code:
var encodedUri = encodeURI(csvContent);
window.open('data:text/plain,' + encodedUri,'_blank').focus();
I'm using firefox in local and it generates correctly a new tab with the data in it, but with firefox or chrome, not in local, the window opens and then close almost immediately (no popup alert triggers)
how may I avoid this and get my file with no problems?
I've a html page that generate a csv with the following code:
var encodedUri = encodeURI(csvContent);
window.open('data:text/plain,' + encodedUri,'_blank').focus();
I'm using firefox in local and it generates correctly a new tab with the data in it, but with firefox or chrome, not in local, the window opens and then close almost immediately (no popup alert triggers)
how may I avoid this and get my file with no problems?
Share Improve this question asked Sep 1, 2017 at 11:46 GodTaxistGodTaxist 716 bronze badges 4- I am having the same issue, with Firefox. If you have found an answer, please let me know. The site with the issue is ayunami2000.github.io – ayunami2000 Commented Nov 7, 2017 at 16:33
- Hi! I never found a real answer to this problem, this is why I didn't post nothing, I found, thus, a nice workaround, take a look at danml./download.html, it's a small lib, very effective, it does everything with a simple download(csvContent, 'something.txt', 'data:text/plain,'); – GodTaxist Commented Nov 8, 2017 at 8:47
- My issue doesn't use downloading; it uses a new window. I could probably use about:blank with injected code, though. Thanks! – ayunami2000 Commented Nov 8, 2017 at 12:43
- were you able to figure this out? – Nirav Gandhi Commented Nov 21, 2017 at 13:55
3 Answers
Reset to default 5Apparently one of the filter lists that uBlock Origin uses es with a rule that unconditionally blocks any data URI popups. https://github./gorhill/uBlock/issues/2465
This is most probably due to AdBlock extension. I disabled it and that solved the issue for me.
All I know is that if you right click and click "Reopen closed tab" after the popup opens, it'll reopen the popup.