Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#65,093 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
frontend

Direzione di ricerca

Inizia in nextcloud-libraries/nextcloud-dialogs, in lib/components/GenericDialog.vue, e analizza il ciclo di vita del listener unload. Verifica come il bundle legacy di webpack produce core-common.js, quindi decidi se il listener debba essere rimosso o sostituito come descritto; il lavoro è completato quando il bundle interessato non registra più l’inefficace listener unload né attiva la violation di Chrome.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
PHP
Stelle
37k
Fork
5.3k
Merge medio
2g 5h
PR unite (30g)
687

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nextcloud/server

Tutte le issue di nextcloud/server

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.