Actions
Task #91123
closedEpic #87417: Integrate proper Content Security Policy (CSP) handling
Task #87418: Refactor and remove usage of inline scripts in backend
Avoid inline JavaScript generated by BackendUtility:viewOnClick
Start date:
2020-04-18
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Sprint Focus:
Description
Inline JavaScript produced by BackendUtility:viewOnClick
is substituted with markup based instructions and static JavaScript event handlers.
// basically delivers window.open(generatedUri) BackendUtility::viewOnClick($pageId, $backPath, $rootLine, $section, $viewUri, $getVars, $switchFocus);
can be substituted with e.g.
\TYPO3\CMS\Backend\Routing\PreviewUriBuilder::create($pageId, $viewUri) ->withRootLine($rootLine) ->withSection($section) ->withAdditionalQueryParameters($getVars) ->serializeDispatcherAttributes([PreviewUriBuilder::OPTION_SWITCH_FOCUS => $switchFocus]);
which results in the following HTML data attributes
(data can be retrieved as array of complete element as well)
... data-dispatch-action="TYPO3.WindowManager.localOpen" data-dispatch-args="["...uri...",null,"previewWin"]"
Actions