Skip to content

Content Security Policy directive: "img-src 'self' data:" #1444

@LorenAmelang

Description

@LorenAmelang

0.44.4
170
16
2020-09-24T23:33:36+02:00

Log attached, showing issue and more...
trilium-2020-11-18.log

Exported note attached...
Gluteus Medius Isolation Exercises - Brace Access.zip

I've noticed Trilium sometimes doesn't show the images from saved whole pages. I'd concluded it couldn't handle .png images, because when I copy one and try to paste it into the note, I get the tiny broken image icon above the caption entry field. If I externally convert it to a .jpg, it pastes properly.

Then I discovered I could use Windows Snipping Tool -> (select) -> File -> Copy, and that version would paste properly. (Even though I now see it pastes a .png file!)

I just dug into this in the note "Gluteus Medius Isolation Exercises - Brace Access.zip"

In Trilium, if I expand the tree, I see all the images that should have been in the saved page, listed in pale type in the tree. In the note, they now have little broken image icons that open the pale image versions. When I first saved the note, those icons did not show! I manually copied and pasted the three images that show in bright type, and "glute-med-anatomy.png" still didn't show up in the note. The ones called just "image.png" are the only ones showing in the note.

So I just peeked into DevTools. There are 68 of these errors shown in Console:

:37840/#root/root/MEOxcpC1CAXa/Kj9FsOHBv8aq/DPI2edKQ39p5/D7QOgvcgphxh/K1Is8ijX7eXS/0Cb37ybQ8pQg-6tcg:1 Refused to load the image 'https://braceaccess.com/wp-content/uploads/2018/05/Monster-Walk-Using-Mini-Bands.png' because it violates the following Content Security Policy directive: "img-src 'self' data:".

Lots of .png files, but plenty of .jpg files as well. But all from http:// pages.

https://stackoverflow.com/questions/40360109/content-security-policy-img-src-self-data
Seems to be saying that policy is a problem, but that relaxing it is a security threat. Personally, I'd be glad to open up the security - I've already seen the page in my browser and decided to save it - Trilium is not like a browser showing random pages for the first time.

But I can't even find the policy in DevTools to try to hack it. Is there a way to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions