nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.54k stars 4.08k forks source link

[Bug]: Incorrect Image Preview Behavior in Mobile Browsers #46045

Open ma-lihui opened 5 months ago

ma-lihui commented 5 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

After upgrading Nextcloud to versions higher than 27, users are unable to preview images directly in mobile browsers. Instead, when clicking on an image file, the browser initiates a download of the image file. This behavior contrasts with the expected behavior seen in desktop browsers, where clicking on an image successfully triggers a preview popup. In version 27 of Nextcloud, this functionality worked as expected in both mobile and desktop browsers.

Steps to reproduce

  1. Access Nextcloud instance using a mobile browser (e.g., Chrome on Android/iOS).
  2. Attempt to click on an image file to preview it.
  3. Note that instead of opening a preview popup, the browser initiates a download of the image file.

Expected behavior

Clicking on an image file in both desktop and mobile browsers should trigger a preview popup, allowing users to view the image without downloading it.

Installation method

Official All-in-One appliance

Nextcloud Server version

29

Operating system

Debian/Ubuntu

PHP engine version

None

Web server

Apache (supported)

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

ma-lihui commented 5 months ago

I found the reason. There are some js errror in safari (both in iPhone and Mac). The safari under v16.3 not support lookbehind regular expressions.

截屏2024-06-28 22 12 44 截屏2024-06-28 22 20 33