Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data urls not working in firefox and chrome #88

Closed
friguzzi opened this issue Jul 13, 2018 · 9 comments
Closed

data urls not working in firefox and chrome #88

friguzzi opened this issue Jul 13, 2018 · 9 comments

Comments

@friguzzi
Copy link
Contributor

data urls seem to be not working anymore in firefox and chrome.
They still work only in safari. So when you want to download a c3 chart, you get nothing.
I think it would be useful to be able to download the svg file

@JanWielemaker
Copy link
Member

I noticed that. Seems to be the same as piskelapp/piskel#729

@JanWielemaker
Copy link
Member

That said, considering the size limitations imposed by some browsers on data URIs it might be wise to keep them on the server and download them the conventional way. That also allows users to download the result using curl, etc. I'll have a look.

@JanWielemaker
Copy link
Member

Pushed 6eed5f4, which keeps the data on the server and uses a normal URL.

@friguzzi
Copy link
Contributor Author

Hi Jan,
did you already update the swish server? It doesn't seem to allow downloads, see e.g.
https://swish.swi-prolog.org/example/rendering.swinb
for the result of the first query (the table)
or
https://swish.swi-prolog.org/example/render_c3.swinb

@JanWielemaker
Copy link
Member

? Both work fine. Not very useful though. You get a very ugly CSV with a single record holding a complicated Prolog term. That is how it should be though. Anyway, the patch is for r_download/0,1 and does not affect CSV downloading. Tried on latest FF.

@friguzzi
Copy link
Contributor Author

I'm speaking about the button that appears by hovering on the rendering, the one besides "List of terms as a table" or "As C3 chart"

@JanWielemaker JanWielemaker reopened this Jul 26, 2018
@JanWielemaker
Copy link
Member

JanWielemaker commented Jul 26, 2018

Fixed with df5ebe7. Not really pretty, but I doubt there is a real solution at this moment. The SVG is generated by the browser. The download attribute demands same origin, but both data and Blob URLs are considered CORS. The only smooth way seems to be to upload the SVG to the server and then download it again ... That doesn't pass my aesthetic requirements ...

The good news is that you can now select the destination file.

P.s. Updated public SWISH. Might need a SHIFT-reload.

@friguzzi
Copy link
Contributor Author

Thanks, it works fine now.

@friguzzi
Copy link
Contributor Author

Now SLDNF trees can be downloaded again!
http://cplint.eu/example/member.swinb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants