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

Save in offline mode appears to be broken in Safari #18

Closed
torkve opened this issue Oct 20, 2016 · 4 comments
Closed

Save in offline mode appears to be broken in Safari #18

torkve opened this issue Oct 20, 2016 · 4 comments

Comments

@torkve
Copy link

torkve commented Oct 20, 2016

One of my colleagues faced a problem with save to device in Safari (as well as "export as xml").

As far as I found, this branch invokes real POST-request to the /save url.
It is opened in new tab and fails, since there's no such URL in offline application, and POST-requests are not supported when app is opened from disk or served by simple file-sharing server (like python -m SimpleHTTPServer). So the resulting xml cannot be saved.

@davidjgraph
Copy link
Collaborator

I'm not personally keen on offline mode in draw.io. Would fully tested Electron apps of draw.io work better for you?

@torkve
Copy link
Author

torkve commented Oct 21, 2016

Hm, I'm not sure. My use-case of offline mode is providing it as a safe intranet service, hence no third-party CDN, integrations with GDrive/Dropbox/OneDrive or any other requests including sending logs to draw.io itself.
Electron app currently lacks this feature and being unfamiliar with Node.JS and Electron, I don't see a way to ditribute and update app with Electron to every end user without NPM installation quest.

@davidjgraph
Copy link
Collaborator

Saving from Safari without using an echo server is a bit of a mess. You'll find discussions like this one on SO, but the upshot is there's no way to make it work on Safari 8,9 and 10, our supported Safari versions.

The most popular JS library for creating a shim is FileSaver.js. You can see in the README that Safari is a problem. You can neither name the file and "sometimes" the blob is opened so you need users to ⌘+S to save.

Saving to file system in the browser is a fairly poor experience.That said, I see the advantage of distributing as a web app, the only way to solve this for Safari will be to have an echo on the server.

We can work out the exact parameters to switch everthing off without stopping comms to the local server, as well. I'd suggest starting with ?db=0&gapi=0&od=0&analytics=0&picker=0&mode=device&browser=0. The logging changes are fairly recent, so it might be that we don't turn that off, we can add something for that.

Then you'd just need a simple echo for /save.

@davidjgraph
Copy link
Collaborator

You're welcome to continue the discussion, but I'll close the issue since it's not possible to do a local save of any reasonable kind in Safari.

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