Bug #78401

Workspaces preview page is broken

Added by Marco Bresch almost 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Category:
Workspaces
Target version:
-
Start date:
2016-10-24
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Since #52877 the JavaScript at the preview page of workspaces is broken:

JavaScript Error in sysext/backend/Resources/Public/JavaScript/ContextHelp.js line 48:
Uncaught DOMException: Blocked a frame with origin "http://t3.dev" from accessing a cross-origin frame.

Schermata 2018-05-02 alle 18.21.14.png View (90.1 KB) Riccardo De Contardi, 2018-05-03 00:05


Related issues

Related to TYPO3 Core - Bug #52877: replace extjs panels with pure css and get rid of the overhead Closed 2013-10-16

Associated revisions

Revision 9f1e1548 (diff)
Added by Alexander Opitz over 1 year ago

[BUGFIX] No CORS Error in WS preview

We should not manipulate document.domain in workspace preview as we need
to communicate with our parent master window.

Releases: master, 8.7
Resolves: #78401
Change-Id: Id3f581545a5547ca4ab8c46ee204b1c947ff6e56
Reviewed-on: https://review.typo3.org/56843
Tested-by: TYPO3com <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Mathias Schreiber <>
Tested-by: Mathias Schreiber <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision ef8e4770 (diff)
Added by Benni Mack over 1 year ago

[BUGFIX] No CORS Error in WS preview

We should not manipulate document.domain in workspace preview as we need
to communicate with our parent master window.

Releases: master, 8.7
Resolves: #78401
Change-Id: Id3f581545a5547ca4ab8c46ee204b1c947ff6e56
Reviewed-on: https://review.typo3.org/56918
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Riccardo De Contardi almost 3 years ago

  • Category set to Workspaces

#2 Updated by Xavier Perseguers over 2 years ago

ping.

#3 Updated by Marco Bresch over 2 years ago

Uuh... I did not recognize that I am the assignee of this issue. I will have a look at the coding night in Malmö.

#4 Updated by Xavier Perseguers over 2 years ago

You're not the assignee but it looked like this ticket was somehow "forgotten".

But cool if you can have a look on your own!

#5 Updated by Alexander Opitz almost 2 years ago

  • Status changed from New to Needs Feedback

What is the state of this issue? Did you have time to look into the issue?

#6 Updated by Riccardo De Contardi almost 2 years ago

Still present in 8.7.9 AFAICS

#7 Updated by Alexander Opitz over 1 year ago

  • Status changed from Needs Feedback to New

Spoke with Riccardo and it is still present.

#8 Updated by Riccardo De Contardi over 1 year ago

Steps to reproduce it on 8.7.13:

1) create custom worskpace
2) create a page and some content
3) modify the content in the workspace
4) click on the view button to preview the page with the "workspace bar"
5) use chrome console to see errors

results: see attached screenshot

#9 Updated by Alexander Opitz over 1 year ago

  • Status changed from New to In Progress
  • Assignee set to Alexander Opitz

#10 Updated by Alexander Opitz over 1 year ago

The issue behind this is CORS and the usage of setting "document.domain" ... see https://developer.mozilla.org/en-US/docs/Web/API/Document/domain

The ContextHelp.js searches for the real backendWindow (from which the Workspace preview was opened as "popup").
The Workspace Preview and Review system uses "document.domain" to set a Domain (since minimum TYPO3 4.5) for CORS in the iframes but as the real backendWindow do not set such thing we are decoupled (in the CORS view).

We have 2 Solutions:
1) Remove all document.domain things from workspace
  • This worked as expected, as the real backendWindow, the "popup" and the iframes inside the "popup" are loaded from same domain. The mentioned parent.resize functionality seams an old comment, slider/tabs & co worked correctly.
  • I tested on Linux with
    • Chrome 65.0.3325.181
    • SeaMonkey 2.49.2
    • Firefox 59.0.2
  • On Windows
    • InternetExplorer 11.0.9600.18977
    • Firefox 59.0.3
  • Someone should test this with IE
2) Add "document.domain = ..." to the backendWindow
  • This needs then also added to all PopUp/Wizards which try to communicate with this backendWindow
  • This would be a breaking change ... also inside backporting to 8 LTS
  • Could produce more hassle then it resolves
3) Remove usage of ContextHelper in Workspace Preview
  • IMHO this is not a real solution as we may later come up to a point where we need to communicate with backendWindow

Summa Summarum, I would favor solution 1.

#11 Updated by Alexander Opitz over 1 year ago

ckeditor seams to use an extra function for IE to circumvent an CORS issue there:

https://github.com/ckeditor/ckeditor-dev/blob/eb4a25a16a6b0241d655f6a94af5d1568c9f2d9f/core/tools.js#L1147

#12 Updated by Gerrit Code Review over 1 year ago

  • Status changed from In Progress to Under Review

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

#13 Updated by Gerrit Code Review over 1 year ago

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

#14 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56918

#15 Updated by Alexander Opitz over 1 year ago

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

#16 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF