Issue Bug Closed

#99286Preview javascript broken in multidomain projects (regression)

Christian Eßl 12/06/22, 10:19 updated 07/09/24, 12:46

Description

Regression introduced in #93706:

The usual behavior:
- When clicking the preview button from the backend, the previewed page will be shown in a new tab
- When clicking the preview button again, the same frontend tab will be reloaded with the new url / changes.

This even worked in a multidomain setup, when the TYPO3 backend domain is different to the frontend domain.

Since the fix in #93706, in a multidomain setup, the reloading of the preview tab would fail because of a cross origin error:

WindowManager.js?bust=4008ca4684026deac234035bd2382cad44143af8:13 

       Uncaught (in promise) DOMException: Blocked a frame with origin "https://backend-domain.at" from accessing a cross-origin frame.
    at t._localOpen (https://backend-domain.at/typo3/sysext/backend/Resources/Public/JavaScript/WindowManager.js?bust=4008ca4684026deac234035bd2382cad44143af8:13:627)
    at Object.localOpen (backend-domain.at/typo3/sysext/backend/Resources/Public/JavaScript/WindowManager.js?bust=4008ca4684026deac234035bd2382cad44143af8:13:406)
    at backend-domain.at/typo3/sysext/backend/Resources/Public/JavaScript/Element/ImmediateActionElement.js?bust=4008ca4684026deac234035bd2382cad44143af8:13:2559

Particularily these changes appear to break the behaviour:
https://review.typo3.org/c/Packages/TYPO3.CMS/+/75492/9/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/WindowManager.ts#b38

Reviews 2