Saving and Exporting in Draw.io

Users and developers helping users with technical Pale Moon issues (Windows and other non-Linux O.S.). Please direct questions about the Linux version to the appropriate Linux board.

Moderators: trava90, satrow

Forum rules
This board is for technical/usage questions and troubleshooting for the Pale Moon browser only. The main focus here is on Pale Moon on Windows. Please direct your questions for Linux, Android and Mac to the dedicated boards.
Technical issues and questions not related to the Pale Moon browser should be posted in "technical chat"
Please keep off-topic and general discussion out of this board, thank you!
User avatar
Isengrim
Astronaut
Astronaut
Posts: 540
Joined: Tue, 08 Sep 2015, 22:54
Location: 127.0.0.1
Contact:

Saving and Exporting in Draw.io

Unread postby Isengrim » Sun, 25 Feb 2018, 17:33

Initially this was going to be a straight support request. After digging into it myself, I managed to find a work-around for the issue, but I still do not know why the issue manifests. Wasn't sure where to put this, so if it belongs in a better subforum feel free to move it.

I occasionally use Draw.io for diagramming, flow charts, etc. Not sure when this started, but saving or exporting drawings to a file on the local computer does not work in Pale Moon. For example, if I go to "Save As..." and then hit the "Device" button, the dialog goes away and nothing else happens. The browser's Save File dialog should appear immediately after hitting the button. This issue is present in the 27.7.2 x64 releases on both Windows 7 and LInux, without any add-ons installed or settings changed (to my knowledge).

The especially annoying part is that there are no errors logged to the web console. The webapp code is minified, but source is available on github. After some digging, I found that some of the code for saving files uses some function called "mxXmlRequest.simulate". And then I happened upon this comment:

Code: Select all

// Workaround for mxXmlRequest.simulate no longer working in Safari
// if this is used (ie PNG export broken after XML export in Safari).

Curious, I decided to experiment by changing my user agent for this site. I created a preference in about config named "general.useragent.override.draw.io" and set it to this value:

Code: Select all

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6

Lo and behold, saving and exporting now works as expected.

A little more digging revealed the source code for the aforementioned simulate method within mxGraph, but that's about as far as I've gotten. If anyone else wants to try their hand at troubleshooting the issue, this might be a good starting point.

tl;dr change your user agent to something Safari-based for Draw.io, and saving or exporting should work correctly.
Last edited by Isengrim on Sun, 25 Feb 2018, 17:38, edited 1 time in total.
Linux Mint 18.3 Cinnamon (64-bit)
Windows 7 (64-bit) (Sometimes)
Windows 10 build 1803 (64-bit) (Sometimes)
We are our choices.

User avatar
adesh
Astronaut
Astronaut
Posts: 569
Joined: Tue, 06 Jun 2017, 07:38

Re: Saving and Exporting in Draw.io

Unread postby adesh » Fri, 09 Mar 2018, 08:52

Sent them a pull request. Let's see if it gets accepted!
https://github.com/jgraph/drawio/pull/232

User avatar
Isengrim
Astronaut
Astronaut
Posts: 540
Joined: Tue, 08 Sep 2015, 22:54
Location: 127.0.0.1
Contact:

Re: Saving and Exporting in Draw.io

Unread postby Isengrim » Fri, 09 Mar 2018, 11:33

I suspect they'll just come back with "your browser isn't supported". That said, I'm still curious as to why that piece of code doesn't work in PM the first place.
Linux Mint 18.3 Cinnamon (64-bit)
Windows 7 (64-bit) (Sometimes)
Windows 10 build 1803 (64-bit) (Sometimes)
We are our choices.


Return to “General support”

Who is online

Users browsing this forum: No registered users and 9 guests