Skip to content

fix: replace JS window.open with links - EXO-89155 - #2072

Merged
ahamdi merged 1 commit into
feature/maintenancefrom
fix/EXO-89155
Sep 7, 2026
Merged

fix: replace JS window.open with links - EXO-89155#2072
ahamdi merged 1 commit into
feature/maintenancefrom
fix/EXO-89155

Conversation

@ahamdi

@ahamdi ahamdi commented Sep 4, 2026

Copy link
Copy Markdown
Member

Why is this change needed?

Prior to this change, opening a document for editing/viewing (and a handful of other document actions — WebDAV drive links, folder navigation, newly-created attachments) called window.open(url, target) directly across the Documents webapp. Direct window.open calls bypass native browser link semantics (no hover preview, no right-click "open in new tab", no middle-click support) and, in one path (EditMenuAction.vue / OpenReadOnlyMenuAction.vue), were reported to pop the editor in a separate browser window instead of a tab depending on browser settings.

How does it address the issue?

This change replaces every window.open call in documents-webapp with real -based navigation:

  • Adds a shared openLink(url, target = '_blank') helper to js/DocumentsUtils.js (exposed as this.$documentsUtils.openLink), used as a drop-in replacement for window.open(url, target) everywhere the target URL is only known inside a dispatcher method (folder vs. file, sometimes after an async fetch). It also correctly handles target: '_self' as an in-place window.location.href navigation rather than a popped window.
  • Extends DocumentActionItem.vue (the shared document context-menu item) with optional href/target props, backward-compatible with every existing non-link action.
  • Converts EditMenuAction.vue and OpenReadOnlyMenuAction.vue — the primary "Edit"/"Open read-only" entries — to real links via computed editLink/readOnlyLink properties, replacing their window.open click handlers.
  • Mechanically swaps the remaining 13 call sites (attachment/main.js, documents/main.js, document-gadget/main.js, DocumentsFileNameCell.vue, FileSearchCard.vue, DocumentListDrawer.vue, DocumentsMain.vue, DocumentInfoDrawer.vue, and 4 attachment components) to this.$documentsUtils.openLink(...).

No functional/URL-building logic changed — only how the resulting URL is navigated to.

Knowledge: none — mechanical window.open → conversion using the addon's existing DocumentsUtils helper pattern, no new architecture or extension point introduced.

@github-actions github-actions Bot added the partialCIBuild Perform Partial CI Build label Sep 4, 2026
@ahamdi ahamdi self-assigned this Sep 4, 2026
@ahamdi
ahamdi enabled auto-merge (squash) September 4, 2026 15:00
@exo-swf
exo-swf force-pushed the feature/maintenance branch from c67d1e7 to cc87970 Compare September 4, 2026 23:23
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ahamdi
ahamdi merged commit a37bfeb into feature/maintenance Sep 7, 2026
4 of 5 checks passed
@ahamdi
ahamdi deleted the fix/EXO-89155 branch September 7, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

partialCIBuild Perform Partial CI Build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants