Project

General

Profile

Actions

Bug #99286

closed

Preview javascript broken in multidomain projects (regression)

Added by Christian Eßl over 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Backend JavaScript
Target version:
-
Start date:
2022-12-06
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #93706: Content element "View" button does not reload pageClosed2021-03-11

Actions
Actions #1

Updated by Georg Ringer over 1 year ago

  • Related to Bug #93706: Content element "View" button does not reload page added
Actions #2

Updated by Alen Bilalovic about 1 year ago

Hi, Is there any update on this issue?
Having the same problem in our installations.

Thanks

Actions #3

Updated by Christian Eßl about 1 year ago

The main problem in the changes from #93706 is this line:

const isInstanceOfWindow = existingWindow.constructor.name === 'Window';

This line will trigger a cross origin error.

Blocked a frame with origin "http://t3coredev.ddev.site" from accessing a cross-origin frame

I am no expert on Javascript, but here is a post, that describes in detail, how troublesome checking the type of an object can be between different windows. Both "x instanceof Window", that #93706 removes and the constructor name check are problematic:

https://stackoverflow.com/questions/332422/get-the-name-of-an-objects-type#answer-332429

Actions #4

Updated by Gerrit Code Review about 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78021

Actions #5

Updated by Gerrit Code Review about 1 year ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78021

Actions #6

Updated by Gerrit Code Review about 1 year ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78021

Actions #7

Updated by Gerrit Code Review about 1 year ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78021

Actions #8

Updated by Christian Eßl about 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #9

Updated by Gerrit Code Review about 1 year ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78571

Actions #10

Updated by Christian Eßl about 1 year ago

  • Status changed from Under Review to Resolved
Actions

Also available in: Atom PDF