jparyani / laverna

Laverna is a JavaScript note taking application with Markdown editor and encryption support. Consider it like open source alternative to Evernote.
https://laverna.cc/index.html
GNU General Public License v3.0
18 stars 3 forks source link

image uploads not working (tested in latest firefox and chromium, OS X) #16

Open zeigerpuppy opened 7 years ago

zeigerpuppy commented 7 years ago

When uploading images to Laverna, the uploaded image is not found. A link is created but there is no image at that link.

editor view:

![enter image description here][1]

[1]: #cffcb8a-a24f-2ef1-1da4-4849a2d12383

in viewer:

https://5c1a0f92d706900897b81fd003c9da5dss.server.net/759e8013-774b-904a-b0d0-c8d2ebc123d5” alt=”enter image description here” title=”” />

If I try browsing to the URL, I get a page that has the laverna favicon (so it looks like the subdomain is fine) but shows a 404 message as the uploaded file is not found.

Is the link being improperly formed?

ps. I have obfuscated some of the link text above to maintain privacy. Also linked images form URLs work fine

zeigerpuppy commented 7 years ago

chromium is returning an error for the image resource:

Not allowed to load local resource: blob:<a href=
jparyani commented 7 years ago

I can confirm, image uploads are broken. I'll either fix it, or remove the option to upload in the next release.

zeigerpuppy commented 7 years ago

I think this may be a change in browser security settings as on old browsers image uploads still work! It looks like browsers have been adjusting their cross-site and local storage settings lately. I'm not sure exactly what the error is but I hope we can retain image uploads!

zeigerpuppy commented 7 years ago

OK, it looks like the issue is that image blobs are not loading correctly (perhaps as they are called form a different subdomain?).

Here's an example of how Laverna parses an uploaded image

<img src="blob:<a href=" https:="" c70ef9adcf28dc35e0b43f123411d599bss.server.net="" 6cf1f423-cec3-184b-b970-33325cfb39ae"="">
https://c70ef9adcf28dc35e0b43f123411d599bss.server.net/6cf1f423-cec3-184b-b970-33325cfb39ae” alt=”enter image description here” title=”” />

this may be relevant: