fluffychat icon indicating copy to clipboard operation
fluffychat copied to clipboard

[Feature] URL Preview

Open krille-chan opened this issue 2 years ago • 5 comments

Description

URL Preview from Matrix API to show Image / Metadate of a linked URL.

Example: /_matrix/media/r0/preview_url?url=https%3A%2F%2Fmatrix.org&ts=1510610716656 HTTP/1.1

Output

{
  "og:title": "Matrix Blog Post",
  "og:description": "This is a really cool blog post from matrix.org",
  "og:image": "mxc://example.com/ascERGshawAWawugaAcauga",
  "og:image:type": "image/png",
  "og:image:height": 48,
  "og:image:width": 48,
  "matrix:image:size": 102400
}

krille-chan avatar Jul 14 '23 23:07 krille-chan

I guess this could also mean direct links to images would be shown? Then it may be a half-way solution for inline gifs even.

nebulade avatar Dec 10 '23 22:12 nebulade

It would also be interesting to be able to disable this function, as vulnerabilities have recently been revealed using cloaking.

BhasherBEL avatar Feb 07 '24 15:02 BhasherBEL

I think there is a property that can be set on a per room basis whether or not you want url previews.

cperrin88 avatar Mar 11 '24 08:03 cperrin88

  • https://spec.matrix.org/latest/client-server-api/#get_matrixmediav3preview_url

Naturally the migration ate the spec link.


It would also be interesting to be able to disable this function, as vulnerabilities have recently been revealed using cloaking.

What vulnerabilities and user cloaking are you referring to?


Note that URL previews shouldn't be performed on client side regardless of the insecurity nightmare Element is requested and performs.

  • https://github.com/element-hq/element-meta/issues/1138#issuecomment-1966165279
  • https://github.com/element-hq/element-meta/discussions/2309
    • https://github.com/krille-chan/fluffychat/issues/912

Mikaela avatar Mar 11 '24 08:03 Mikaela

+1

yannikthegenius avatar Sep 23 '24 11:09 yannikthegenius

Will this ever be implemented?

bluewalk avatar Aug 17 '25 10:08 bluewalk

Hey, at the moment we're uncomfortable implementing this feature because it can easily bypass end-to-end encryption. As soon as there's a solution or a good alternative, we'll address it.

Janavanwalde avatar Oct 20 '25 07:10 Janavanwalde

Why don't you implement it similarly to the element client? There you have a setting on room level. That setting is already part of the standard room setting data. There you can deactivate previews for the whole room.

As other clients already implement this you gain no security as the chat partners might already be generating previews.

cperrin88 avatar Oct 20 '25 08:10 cperrin88