Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Bug]: F-37 Generic dialogs register an `unload` listener (Chrome: "Permissions policy violation: unload is not allowed")

Đang mở Phù hợp với người mới
#65,093 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu trong nextcloud-libraries/nextcloud-dialogs tại lib/components/GenericDialog.vue và kiểm tra vòng đời của unload listener. Kiểm tra cách legacy webpack bundle tạo ra core-common.js, sau đó quyết định xem listener có nên được xóa hoặc thay thế như mô tả hay không; hoàn tất nghĩa là bundle liên quan không còn đăng ký unload listener không hiệu quả hoặc kích hoạt Chrome violation.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

0. Needs triage 35-feedback bug
⚠️ This issue respects the following points: ⚠️
  • This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
  • This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
  • I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
  • I agree to follow Nextcloud's Code of Conduct.
  • I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.
Bug description

F-37 · Generic dialogs register an unload listener (Chrome: "Permissions policy violation: unload is not allowed")

Repository nextcloud-libraries/nextcloud-dialogs
Severity Low (console violation on every confirmation dialog; the listener has no effect)
Component lib/components/GenericDialog.vue
Affects @nextcloud/dialogs 7.5.0, used by Nextcloud 35.0.1 (e.g. the confirmation when deleting files)
Verified Chrome DevTools on a production instance; source of the bundled library

What happens

Deleting files shows the confirmation dialog, and Chrome logs

[Violation] Permissions policy violation: unload is not allowed in this document.
    confirmDestructive @ dialogs.js …

Cause

const handleUnload = () => `${props.name}: ${props.text}`
onMounted(() => window.addEventListener('unload', handleUnload))
onUnmounted(() => window.removeEventListener('unload', handleUnload))

The return value of an unload handler is ignored, so the listener does nothing. It looks like it
was meant to be beforeunload (warn before leaving the page while a dialog is open). Chrome is
phasing out unload and blocks it by default on more and more sites, which produces the violation.

Suggestion

Use beforeunload with event.preventDefault() if the warning is wanted, or remove the listener.
The patch in this package removes it in the legacy (webpack) bundle, core-common.js, which the
Files app uses. The copy in the Vite bundles stays: rebuilding them renames hundreds of chunk files.

Steps to reproduce

see the top

Expected behavior

see the top

Nextcloud Server version

35

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

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

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

Ngôn ngữ chính
PHP
Star
37k
Fork
5.3k
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
677

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nextcloud/server

Tất cả issue của nextcloud/server

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.