[Bug]: F-37 Generic dialogs register an `unload` listener (Chrome: "Permissions policy violation: unload is not allowed")
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
⚠️ 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
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nextcloud/server
-
0. Needs triage 35-feedback bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage 35-feedback bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage 35-feedback bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage 35-feedback bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage 35-feedback bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di nextcloud/server
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
invoiceninja/invoiceninja#13320 ·
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Перевод устарел
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
[Type] Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug repo:cms
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
craftcms/cms#19828 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno