Closed RFSH closed 4 years ago
I don't know if you've already considered this, but modern Firefox has security/privacy options around canvas access.
I was having problems with a different plotly-based viewer until I found the little content-blocking menu and opted in to allow more access on my browser... until I recognized the little icon in the location bar, I was confused by the silent failure of the plotly app functions.
@karlcz do you remember which setting it was on Firefox?
The html2canvas
is creating a canvas for us and then we're generating a downloadable image based on that canvas.
Since we're using canvas it might have the same issue, but Firefox is not showing me any warning so I can opt-in. Disabling the "Enhanced tracking protection" didn't make any difference either.
It was just a small content-blocking modal menu that opens when you click on the little icons in the left edge of the location bar, near the TLS "padlock" or similar site security indicators.
I deployed the old chaise code that works with the changes in #9 in the following:
It has the same issue. Based on the comments on the issue, it used to work properly for Mac/Firefox. So most probably something might have changed in how Firefox is handling this and as karl pointed out it could be related to a privacy setting in the browser.
I spend more time trying to figure this out. I created this jsfiddle so I can test different versions with different browsers. When I started working on this the latest version was rc5, and based on my testing alpha1 and alpha2 versions were the only versions that could handle simple SVG on Firefox/Safari/Chrome. But in the following days, they introduced rc7 which fixed most of the issues that I was experiencing.
So I decided to bump our version (we were using rc3), but that didn't help. I still couldn't get the annotations in Firefox and Safari using rc7. Using foreignObjectRendering
fixed the issue for Firefox, but completely broke the Safari screenshot because of the strict privacy policies of Safari. Also, the alpha1 and alpha2 wouldn't work at all with any of the browsers.
In the end, I decided to completely remove html2canvas from our repo and add the SVG overlays manually. This way I'm completely in control of how the app behaves and it's not just a black-box that I was trying to understand. Besides, html2canvas is good if we're trying to convert the whole HTML page without worrying about its content. In our case, osd is giving us a canvas and all we had to do was adding the extra SVG overlays.
As title suggests, the screenshot feature (
exportViewToJPG
function) is not working on Firefox and Safari. It works properly on chrome, however.We're using
html2canvas
for this feature. So I was looking into if this is a known issue. From what I gathered so far, SVGs should show properly as long and the only known issue is when the SVGs don't have any width/height property. But that's not the case in our SVGs since we're always attaching width and height.I couldn't find any other source for this bug so I decided to create this issue for now. We might want to find more information about this, and if this wasn't fixable, we can start looking at alternative solutions.