GenericDialog registers an unload listener that has no effect
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 66/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- frontend
调研方向
阅读 lib/components/GenericDialog.vue,跟踪注册和移除 unload 监听器的对话框生命周期钩子。判断对话框是否应在导航前发出警告,还是应移除监听器;issue 提供了这两种选项。完成标准是处理无效的监听器及其违反 unload 策略的问题,并确保对话框打开时行为一致。
由索引模型根据 Issue 内容生成。
描述
Description
Moved from nextcloud/server#65093 (issues can't be transferred between organizations).
lib/components/GenericDialog.vue registers an unload listener while a generic dialog (e.g. getDialogBuilder() / the delete confirmation in Files) is open:
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 has no effect. Chrome is phasing out unload and blocks it by default on more and more sites, which logs a violation every time such a dialog is opened:
[Violation] Permissions policy violation: unload is not allowed in this document.
It was probably meant to be a beforeunload handler that warns before leaving the page while a dialog is open.
Suggestion
Either switch to beforeunload with event.preventDefault() (if the warning is wanted) or remove the listener.
Reported for @nextcloud/dialogs 7.5.0 as used by Nextcloud 35; still present on main.
- 主要语言
- TypeScript
- 星标
- 19
- 派生
- 10
- 平均合并
- 17 小时 4 分钟
- 30 天内合并 PR
- 30
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nextcloud-libraries/nextcloud-dialogs 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
nextcloud-libraries/nextcloud-dialogs#2771 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
nextcloud-libraries/nextcloud-dialogs#2770 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
nextcloud-libraries/nextcloud-dialogs#2756 · 1 个 reaction ·
维护者通常 1 天内回复
-
1. to develop
难度 2/5 1-3 小时 新手友好度 65/100
nextcloud-libraries/nextcloud-dialogs#2669 · 1 条评论 ·
维护者通常 1 天内回复
-
1. to develop
难度 4/5 3-5 天 新手友好度 48/100
nextcloud-libraries/nextcloud-dialogs#2510 · 2 条评论 ·
维护者通常 1 天内回复
查看 nextcloud-libraries/nextcloud-dialogs 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
Make the "%" unit spacing the same in the web and in A10可能已有人在做 @kragent66-glitch 今天认领。 未关闭bug good first issue
难度 2/5 1-3 小时 新手友好度 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 条评论 ·
-
Editor: leave an uploaded or inserted image's alt text empty, so the preview asks for a description未关闭
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 65/100
sveltejs/svelte.dev#2417 ·
维护者通常 1 天内回复
-
[Bug]: A Markdown link with both a :line suffix and a #L fragment opens a path containing ":line"未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复