Feature #76459

Add crossorigin property to JavaScript files

Added by Jacob Dreesen about 3 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Frontend
Start date:
2016-06-05
Due date:
% Done:

100%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Add support for CORS settings attributes for JavaScript files.

This is mainly needed for loading remote JavaScript files for example from a CDN, especially when used together with Subresource Integrity (SRI) (which was added in #66698).

SRI requires CORS to work and thus is not usable without the crossorigin attribute for JavaScript files coming from other domains (origins). (Note that CORS must be enabled by the CDN, too.)

Therefore the crossorigin attribute should be automatically added with an anonymous value for external JavaScript files when SRI is enabled and the user does not explicitely set it.


Related issues

Related to TYPO3 Core - Bug #78262: Missing CORS settings attribute when using integrity with includeJS Closed 2016-10-12
Duplicated by TYPO3 Core - Bug #76944: Subrequest-integrity should also add cross-origin header Rejected 2016-07-05
Duplicated by TYPO3 Core - Bug #77873: Missing crossorigin property for JavaScript files (SRI) Closed 2016-09-07

Associated revisions

Revision c4af34c4 (diff)
Added by Jacob Dreesen almost 2 years ago

[FEATURE] Add crossorigin property to JavaScript files

Add a property 'crossorigin="some-value"' to JavaScript files via TypoScript
page.includeJSlibs.<array>.crossorigin = some-value

The crossorigin property is automatically set to the value "anonymous" for
external JavaScript files with an integrity property if not explicitly set.

This patch affects the TypoScript PAGE properties
  • includeJSlibs
  • includeJSFooterlibs
  • includeJS
  • includeJSFooter

Resolves: #76459
Releases: master
Change-Id: Ie8d1d86ca5a8863c2a637395f1f87a463729691c
Reviewed-on: https://review.typo3.org/48455
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>
Tested-by: TYPO3com <>
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>

History

#1 Updated by Gerrit Code Review about 3 years ago

  • Status changed from New to Under Review

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

#2 Updated by Gerrit Code Review about 3 years ago

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/48455

#3 Updated by Gerrit Code Review almost 2 years 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/48455

#4 Updated by Gerrit Code Review almost 2 years ago

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

#5 Updated by Gerrit Code Review almost 2 years ago

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

#6 Updated by Gerrit Code Review almost 2 years ago

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

#7 Updated by Gerrit Code Review almost 2 years ago

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

#8 Updated by Gerrit Code Review almost 2 years ago

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

#9 Updated by Jacob Dreesen almost 2 years ago

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

#10 Updated by Benni Mack 11 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF