Review main Merged

93620[TASK] Unify the top level window access

Benjamin Kott CR +2 V +2 Expert +765 −382 updated 10/15/26, 15:42

Commit message

Modules reached the top level window by hand across the JavaScript
stack, in different spellings and mostly unguarded, and told whether
they ran in a frame by comparing their location with the parent's.
@typo3/core/utility/top-window now provides topWindow and topDocument
for this, and openerTopWindow() for a window opened by another one.

topWindow is the outermost window carrying the TYPO3 object. That is
not `top` where an application embeds the backend, and an embedding
window may be of another origin where the clickjacking protection
header has been lifted for it. The lookup therefore stops at the first
window it is not allowed to read. It is resolved once per document,
because the windows above a frame keep their documents as long as the
frame exists. An opener can navigate or close while the window it
opened lives, so openerTopWindow() is resolved on every call. Any site
may be that opener, since the backend sends no
Cross-Origin-Opener-Policy, and the date picker used to throw on one.

`Window.top` is typed nullable, so strictNullChecks reports every bare
`top.` as an error, and topWindow clears that group in one place. An
application embedding the backend leaves `top.TYPO3` undefined, which
turned every unguarded lookup into a TypeError. Modal, Notification,
Severity, LoginRefresh and the persistent storage now share their
instance through topWindow as well, and the login mask and the
installer redirect topWindow, so they no longer navigate an embedding
application away.

Whether a module runs in a frame is now the question whether a window
carrying TYPO3 sits above it. Asked of any frame, the embedded backend
window answered it for itself: the sudo mode verification dispatched
itself again instead of opening its modal, and the install tool
rendered its messages into the embedding document.

The user settings reach the persistent storage as a global assignment,
which runs before any module, rather than through a module instruction.
The content navigation read them before that instruction had run and
fetched them again with a synchronous request, and modules in frames
did the same with an instance of their own. Neither happens any longer.

The clipboard panel no longer depends on the top level window at all.
The record list and the file list hand it the URL it posts to, so the
panel also works in a module opened in a tab of its own, where it
failed before.

Review

  • Code review CR +2 Done
    • Benjamin Kott +2
    • Benjamin Franzke +1
  • Verified V +2 Done
    • Benjamin Kott +2
    • Benjamin Franzke +1
    • core-ci +1 CI

Issues 1

Files 174

Show 154 more files

Review log 2131

Show 36 earlier messages
  1. Benjamin Kott uploaded patch set 1 04/10/26, 23:56

  2. core-ci voted on patch set 1 V +1 04/11/26, 00:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99935

  3. Benjamin Kott uploaded patch set 2 V +1 09/09/26, 13:44

  4. core-ci voted on patch set 2 V +1 09/09/26, 13:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108187

  5. Benjamin Kott uploaded patch set 3 V +1 09/09/26, 18:31

  6. core-ci voted on patch set 3 V +1 09/09/26, 18:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108212

  1. Simon Schaufelberger voted on patch set 3 CR +1 V +1 09/09/26, 22:42

  2. Benjamin Franzke commented on patch set 3 CR -1 09/10/26, 06:59

    On hold, discussing details, since we had different ideas in the past, e.g. 80556: [TASK] Streamline top frame detection | https://review.typo3.org/c/Packages/TYPO3.CMS/+/80556
  3. Benjamin Kott uploaded patch set 4 CR +1 V +1 09/10/26, 10:13

  4. core-ci voted on patch set 4 V +1 09/10/26, 10:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108249

  5. Benjamin Kott marked it work in progress 09/10/26, 10:48

  6. Benjamin Kott uploaded patch set 5 V +1 10/09/26, 21:25

  7. Benjamin Kott commented on patch set 5 10/09/26, 21:34

    This change is ready for review.
  8. core-ci voted on patch set 5 V +1 10/09/26, 21:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110727

  9. Benjamin Kott uploaded patch set 6 V +1 10/09/26, 21:37

  10. core-ci voted on patch set 6 V +1 10/09/26, 21:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110734

  11. Benjamin Kott uploaded patch set 7 V +1 10/13/26, 11:09

  12. core-ci voted on patch set 7 V +1 10/13/26, 11:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111003

  13. Benjamin Kott uploaded patch set 8 V +1 10/15/26, 10:47

  14. Benjamin Franzke voted on patch set 8 CR +1 V +1 10/15/26, 10:57

  15. core-ci voted on patch set 8 V -1 10/15/26, 11:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111180

  16. Benjamin Kott uploaded patch set 9 CR +1 V +1 10/15/26, 12:20

  17. core-ci voted on patch set 9 V +1 10/15/26, 12:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111189

  18. Benjamin Franzke voted on patch set 9 CR +1 V +1 10/15/26, 13:50

  19. Simon Schaufelberger voted on patch set 9 CR +1 V +1 10/15/26, 13:59

  20. Benjamin Kott voted on patch set 9 CR +2 V +2 10/15/26, 14:16

  21. Benjamin Kott uploaded patch set 10 CR +1 V +1 10/15/26, 15:30

  22. core-ci voted on patch set 10 V +1 10/15/26, 15:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111217

  23. Benjamin Franzke voted on patch set 10 CR +1 V +1 10/15/26, 15:41

  24. Benjamin Kott voted on patch set 10 CR +2 V +2 10/15/26, 15:42

  25. Benjamin Kott merged patch set 11 10/15/26, 15:42