clickstorm / cs_seo

[clickstorm] SEO
Other
33 stars 49 forks source link

Bug: Page results doesn't work with backend-CSP #341

Open SusiSorglos opened 1 month ago

SusiSorglos commented 1 month ago

The cs-seo backend-module (typo3/module/web/cs-seo/page-results?id=[...]) display no results when [SYS][features][security.backend.enforceContentSecurityPolicy] = true. This happens because the cs_seo JavaScripts are blocked by the TYPO3 CSP restrictions in the backend. If I set [SYS][features][security.backend.enforceContentSecurityPolicy] to "false" it works. Can you please fix this because disabling backend-CSP is not a good option for security reasons. Tested in TYPO3 12.4.20

mhirdes commented 3 weeks ago

I merged the PR. May you can test?

SusiSorglos commented 3 weeks ago

Thanks for the patch! The result for the first level (= the selected page) is now visible. But I can't change the page-depth per selectbox to display also the results of the subpages. I think the CSP blockes the JavaScript in the onchange-attribute of the select-box:

<select onchange="this.form.submit();" class="form-select" id="depth" name="depth">

It seems also that the angular.js is blocked by the CSP.

I got the following error-messages:

csp-problem

Adding the onchange-function via "addEventListener" could possibly solve the problem with "this.form.submit()".

SusiSorglos commented 3 weeks ago

Sorry, I accidentally closed the issue...